-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
39 lines (34 loc) · 908 Bytes
/
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
import path from 'path';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
import replace from '@rollup/plugin-replace';
import svgr from 'vite-plugin-svgr';
import eslint from 'vite-plugin-eslint';
import checker from 'vite-plugin-checker';
import { pwaOptions, replaceOptions } from './src/pwa/options';
const resolvePath = (dir) => path.join(__dirname, dir);
// https://vitejs.dev/config
export default defineConfig(({ mode }) => ({
base: mode === 'development' ? '/' : '/RCNode/',
build: {
sourcemap: process.env.SOURCE_MAP === 'true',
},
plugins: [
react(),
VitePWA(pwaOptions),
replace(replaceOptions),
svgr(),
eslint(),
checker({ typescript: true }),
],
resolve: {
alias: {
'@/': resolvePath('./src/'),
},
},
server: {
host: '0.0.0.0',
port: 3210,
},
}));