generated from chibat/chrome-extension-typescript-starter
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
vite.config.chromium.ts
34 lines (32 loc) · 977 Bytes
/
vite.config.chromium.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
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('chromium'),
useDynamicUrlWebAccessibleResources: false,
}),
],
resolve: {
alias: [{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }],
},
build: {
minify: !isDev,
sourcemap: isDev,
target: 'chrome105',
rollupOptions: {
output: {
dir: 'dist/browser-extension/chromium',
},
},
},
})