forked from antfu-collective/vitesse-webext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.content.ts
43 lines (41 loc) · 1.05 KB
/
vite.config.content.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
import { defineConfig } from 'vite';
import windiCSS from 'vite-plugin-windicss';
import { sharedConfig } from './vite.config';
import { r } from './scripts/utils';
import windiConfig from './windi.config';
import packageJson from './package.json';
// bundling the content script using Vite
export default defineConfig({
...sharedConfig,
mode: 'development',
build: {
watch: {},
outDir: r('dist/contentScripts'),
cssCodeSplit: false,
emptyOutDir: false,
sourcemap: 'inline',
lib: {
entry: r('src/contentScripts/index.ts'),
name: packageJson.name,
formats: ['iife'],
},
rollupOptions: {
output: {
entryFileNames: 'index.global.js',
extend: true,
},
},
},
plugins: [
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
...sharedConfig.plugins!,
// https://github.com/antfu/vite-plugin-windicss
windiCSS({
config: {
...windiConfig,
// disable preflight to avoid css population
preflight: false,
},
}),
],
});