-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
vite.config.js
43 lines (41 loc) · 892 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
/* eslint-disable import/no-extraneous-dependencies */
import react from '@vitejs/plugin-react';
import { reuse } from 'alias-reuse';
import path from 'path';
import { defineConfig } from 'vite';
import checkerPlugin from 'vite-plugin-checker';
import { viteStaticCopy } from 'vite-plugin-static-copy';
const tsconfig = path.resolve(__dirname, 'tsconfig.json');
export default defineConfig(({ mode }) => ({
plugins: [
react(),
checkerPlugin({
typescript: true,
}),
viteStaticCopy({
targets: [{
src: 'assets',
dest: '',
}],
}),
],
root: './src',
base: '',
build: {
target: 'esnext',
outDir: '../dist',
emptyOutDir: true,
assetsDir: '',
},
server: {
port: 9999,
},
define: {
ENV_MODE: JSON.stringify(mode),
},
resolve: {
alias: reuse()
.from(tsconfig)
.for('vite'),
},
}));