-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.ts
46 lines (44 loc) · 1.05 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
import { resolve } from 'path';
import { defineConfig } from 'vite';
export default defineConfig({
root: 'src',
publicDir: resolve(process.cwd(), 'public'),
esbuild: {
target: 'es2022',
},
build: {
assetsInlineLimit: 0,
polyfillModulePreload: false,
target: 'es2020',
rollupOptions: {
input: {
test: resolve(__dirname, 'src/test.html'),
sidebarpanel: resolve(__dirname, 'src/sidebarpanel.html'),
devtools: resolve(__dirname, 'src/devtools.html'),
// not support module
content: resolve(__dirname, 'src/content.ts'),
},
output: {
assetFileNames: '[name].[ext]',
chunkFileNames(info) {
return info.name + '.js';
},
entryFileNames(info) {
return info.name + '.js';
},
manualChunks: {
gem: ['@mantou/gem'],
},
},
},
outDir: resolve(process.cwd(), 'extension'),
emptyOutDir: false,
sourcemap: true,
minify: false,
},
resolve: {
alias: {
src: '',
},
},
});