-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
39 lines (38 loc) · 991 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
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'path'
import { terser } from 'rollup-plugin-terser'
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
if (mode === 'browser-build') {
return {
base: '/notepad/',
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'index.html'),
notepad: resolve(__dirname, 'notepad.html'),
preferences: resolve(__dirname, 'preferences.html')
},
},
outDir: "browser-build"
},
plugins: [react(), terser()],
}
}
return {
server: {
port: 3000
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'index.html'),
notepad: resolve(__dirname, 'notepad.html'),
preferences: resolve(__dirname, 'preferences.html')
},
},
},
plugins: [react(), terser()],
}
})