-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathvite.config.ts
35 lines (33 loc) · 1.26 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { fileURLToPath } from 'node:url';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import IstanbulPlugin from 'vite-plugin-istanbul';
import tsconfigPaths from 'vite-tsconfig-paths';
// https://vitejs.dev/config/
export default defineConfig(() => {
return {
define: {
'process.env.STORYBOOK_ENV': `'${process.env.STORYBOOK_ENV}'`
},
resolve: {
alias: {
'@sb': fileURLToPath(new URL('./.storybook', import.meta.url)),
'@ui5/webcomponents-react-base': fileURLToPath(new URL('./packages/base/src/index.ts', import.meta.url)),
'@ui5/webcomponents-react-charts': fileURLToPath(new URL('./packages/charts/src/index.ts', import.meta.url)),
'@ui5/webcomponents-react/dist': fileURLToPath(new URL('./packages/main/src/', import.meta.url)),
'@ui5/webcomponents-react': fileURLToPath(new URL('./packages/main/src/index.ts', import.meta.url)),
'@/': fileURLToPath(new URL('./', import.meta.url))
}
},
plugins: [
react(),
process.env.CYPRESS === 'true' &&
IstanbulPlugin({
cypress: true
}),
tsconfigPaths({
projects: [fileURLToPath(new URL('tsconfig.base.json', import.meta.url))]
})
].filter(Boolean)
};
});