-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.firefox.ts
50 lines (45 loc) · 1.13 KB
/
vite.config.firefox.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
import { defineConfig } from 'vite'
import { resolve } from 'path'
import react from '@vitejs/plugin-react'
import { crx } from '@crxjs/vite-plugin'
import svgr from 'vite-plugin-svgr'
import { rmDotVite } from './custom-plugins'
import manifest from './manifest.firefox.json'
import zipPack from 'vite-plugin-zip-pack'
const isWatch = process.argv.includes('--watch')
export default defineConfig({
plugins: [react(), crx({ manifest, browser: 'firefox' }), svgr(), rmDotVite(),
isWatch
? null
: zipPack(
{
outDir: 'packages',
inDir: 'dist-firefox',
outFileName: `${manifest.name.replaceAll(' ', '-')}-v${manifest.version}-Firefox.zip`,
}
)],
root: resolve(__dirname, ''),
build: {
outDir: resolve(__dirname, 'dist-firefox'),
rollupOptions: {
input: {
record: resolve(__dirname, 'pages/record_result/index.html'),
},
}
},
css: {
modules: {
localsConvention: 'camelCase'
}
},
optimizeDeps: {
exclude: ['@ffmpeg/ffmpeg']
},
server: {
port: 5173,
strictPort: true,
hmr: {
port: 5173,
},
},
})