-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.js
43 lines (42 loc) · 936 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
import { dirname, relative } from 'path'
import { defineConfig, } from 'vite'
import { r, port, isDev } from './scripts/utils';
export default defineConfig(({ command }) => ({
root: r('src'),
publicDir: r('public'),
define: {
__DEV__: isDev,
},
resolve: {
alias: {
'~/': `${r('src')}/`,
},
},
base: '/',
server: {
port,
hmr: {
host: 'localhost',
},
},
build: {
outDir: r('dist'),
emptyOutDir: true,
minify: false,
sourcemap: isDev ? 'inline' : false,
// https://developer.chrome.com/docs/webstore/program_policies/#:~:text=Code%20Readability%20Requirements
terserOptions: {
mangle: false,
},
rollupOptions: {
input: {
background: r('src/background.js'),
content: r('src/content.js'),
popup: r('src/popup/index.html')
},
output: {
entryFileNames: 'assets/[name].js',
}
},
},
}));