-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
52 lines (51 loc) · 1.21 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgrPlugin from 'vite-plugin-svgr'
const path = require('path')
// https://vitejs.dev/config/
export default defineConfig({
// This changes the out put dir from dist to build
// comment this out if that isn't relevant for your project
// build: {
// outDir: 'build',
// },
resolve:{
alias:{
'src' : path.resolve(__dirname, './src')
},
},
test: {
globals: true,
environment: 'happy-dom',
// environment: 'jsdom'
},
plugins: [
react(
{
jsxImportSource: "@emotion/react",
babel: {
plugins: [
'babel-plugin-macros',
// 'macros',
[
"@emotion/babel-plugin",
{
"sourceMap": true,
"autoLabel": "dev-only",
"labelFormat": "[local]",
"cssPropOptimization": true
}
]
]
},
// Exclude storybook stories
exclude: /\.stories\.(t|j)sx?$/,
}),
svgrPlugin({
svgrOptions: {
icon: true,
// ...svgr options (https://react-svgr.com/docs/options/)
},
}),
],
});