-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
49 lines (46 loc) · 1.31 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
import path from 'path'
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import eslint from 'vite-plugin-eslint'
// eslint-disable-next-line import/no-unresolved
import macrosPlugin from 'vite-plugin-babel-macros'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
export default defineConfig({
plugins: [
react(),
eslint(),
// Used for 'styled-components/macro'
macrosPlugin(),
],
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
},
resolve: {
alias: {
process: 'process/browser',
global: path.resolve(__dirname, './src/global'),
GlobalStyled: path.resolve(__dirname, './src/GlobalStyled'),
components: path.resolve(__dirname, './src/components'),
containers: path.resolve(__dirname, './src/containers'),
modules: path.resolve(__dirname, './src/modules'),
lib: path.resolve(__dirname, './src/lib'),
assets: path.resolve(__dirname, './src/assets'),
},
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'globalThis',
},
plugins: [NodeGlobalsPolyfillPlugin({ buffer: true }) as any],
},
},
build: {
manifest: true,
sourcemap: true,
rollupOptions: {
plugins: [rollupNodePolyFill({ exclude: ['fs'] })],
},
},
})