-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.js
45 lines (44 loc) · 883 Bytes
/
vite.config.js
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
import { defineConfig } from 'vite'
// import postcss from './postcss.config.js'
import react from '@vitejs/plugin-react'
import dsv from '@rollup/plugin-dsv'
import eslint from 'vite-plugin-eslint'
import jsconfigPaths from 'vite-jsconfig-paths'
// https://vitejs.dev/config/
export default defineConfig({
define: {
'process.env': process.env
},
// css: {
// postcss,
// },
esbuild: {
loader: 'jsx',
},
optimizeDeps: {
esbuildOptions: {
loader: {
'.js': 'jsx',
},
},
},
plugins: [react(), dsv(), jsconfigPaths(), eslint({
failOnWarning: false,
failOnError: false,
})],
resolve: {
alias: [
{
find: /^~.+/,
replacement: (val) => {
return val.replace(/^~/, "");
},
},
],
},
build: {
commonjsOptions: {
transformMixedEsModules: true,
}
}
})