-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathvite.config.ts
52 lines (51 loc) · 1.14 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
47
48
49
50
51
52
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'url'
import { crx } from '@crxjs/vite-plugin'
import manifest from './src/extension/manifest.json'
// https://vitejs.dev/config/
export default defineConfig({
publicDir: './public',
define: {
'process.env': {}
},
resolve: {
extensions: ['.ts', '.js', '.vue'],
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
stream: 'stream-browserify',
http: 'http-browserify',
https: 'https-browserify',
util: 'util'
}
},
build: {
rollupOptions: {
// plugins: [nodePolyfills()],
onwarn: (warning) => {
if (warning.message.includes('comment will be removed')) {
return false;
}
return true;
},
input: {
['eval-sandbox']: 'eval-sandbox.html',
},
},
sourcemap: false,
chunkSizeWarningLimit: 1000,
commonjsOptions: {
transformMixedEsModules: true
},
},
esbuild: {
legalComments: 'none',
},
plugins: [
crx({ manifest: manifest as any }),
vue()
],
server: {
port: 4766
}
})