generated from chibat/chrome-extension-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
vite.config.firefox.ts
35 lines (33 loc) · 1022 Bytes
/
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
import { defineConfig } from 'vite'
import webExtension from '@samrum/vite-plugin-web-extension'
import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths'
import svgr from 'vite-plugin-svgr'
import { fileURLToPath, URL } from 'url'
import { getManifest } from './src/browser-extension/manifest'
const isDev = process.env.NODE_ENV === 'development'
export default defineConfig({
plugins: [
tsconfigPaths(),
react(),
svgr(),
webExtension({
manifest: getManifest('firefox'),
useDynamicUrlWebAccessibleResources: false,
}),
],
resolve: {
alias: [{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }],
},
build: {
assetsInlineLimit: 1024 * 1024, // 1mb
minify: !isDev,
sourcemap: isDev,
target: 'chrome105',
rollupOptions: {
output: {
dir: 'dist/browser-extension/firefox',
},
},
},
})