-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathvite.config.ts
More file actions
42 lines (40 loc) · 1.28 KB
/
vite.config.ts
File metadata and controls
42 lines (40 loc) · 1.28 KB
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
36
37
38
39
40
41
42
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-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)),
},
},
optimizeDeps: {
esbuildOptions: {
target: 'esnext',
},
},
build: {
target: 'esnext',
},
plugins: [
react(),
process.env.CYPRESS === 'true' &&
IstanbulPlugin({
cypress: true,
}),
tsconfigPaths({
projects: [fileURLToPath(new URL('tsconfig.base.json', import.meta.url))],
}),
].filter(Boolean),
};
});