-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvite.config.ts
35 lines (34 loc) · 988 Bytes
/
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
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import { crx } from '@crxjs/vite-plugin'
import manifest from './src/manifest'
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
build: {
emptyOutDir: true,
outDir: 'build',
sourcemap: true,
minify: false,
target: ['esnext', 'edge89', 'firefox89', 'chrome89', 'safari15'],
rollupOptions: {
output: {
format: 'module',
chunkFileNames: 'assets/[name].js',
manualChunks: {
'common': ['src/common/extract-links.ts', 'src/common/settings.ts'],
'background': ['src/background/index.ts'],
'contentScript': ['src/contentScript/index.ts', 'src/contentScript/extractor.ts'],
'options': ['src/options/index.ts'],
'popup': ['src/popup/index.ts'],
},
},
},
},
plugins: [crx({ manifest })],
test: {
include: ['test/**/*.test.ts'],
setupFiles: './vitest.init.ts',
},
}
})