-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathvite.config.js
More file actions
65 lines (64 loc) · 1.43 KB
/
vite.config.js
File metadata and controls
65 lines (64 loc) · 1.43 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import { resolve } from 'path';
import { crx } from '@crxjs/vite-plugin';
import Icons from 'unplugin-icons/vite';
import AutoImport from 'unplugin-auto-import/vite';
import tailwindcss from '@tailwindcss/vite';
import manifest from './manifest.chrome.json';
export default defineConfig({
plugins: [
vue(),
tailwindcss(),
crx({ manifest }),
Icons({
autoInstall: true,
}),
AutoImport({
imports: [
{
'webextension-polyfill': [['default', 'browser']],
},
],
dts: false,
}),
],
optimizeDeps: {
include: ['webextension-polyfill', 'unplugin-icons', 'unplugin-auto-import'],
},
resolve: {
alias: {
'@': resolve(__dirname, 'src'),
},
},
root: resolve(__dirname, 'src'),
publicDir: resolve(__dirname, 'public'),
build: {
outDir: resolve(__dirname, 'dist/chrome'),
rollupOptions: {
input: {
app: '/ext/browser/index.html',
},
},
minify: 'terser',
sourcemap: false,
// https://developer.chrome.com/docs/webstore/program_policies/#:~:text=Code%20Readability%20Requirements
terserOptions: {
mangle: false,
compress: {
drop_console: true,
drop_debugger: true,
},
},
},
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
},
test: {
cache: false,
},
});