mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import WindiCSS from 'vite-plugin-windicss'
|
|
import { sharedConfig } from './vite.config'
|
|
import { r, isDev } from './scripts/utils'
|
|
import windiConfig from './windi.config'
|
|
import packageJson from './package.json'
|
|
|
|
// bundling the content script using Vite
|
|
export default defineConfig({
|
|
...sharedConfig,
|
|
build: {
|
|
watch: isDev
|
|
? {}
|
|
: undefined,
|
|
outDir: r('extension/dist/contentScripts'),
|
|
cssCodeSplit: false,
|
|
emptyOutDir: false,
|
|
sourcemap: isDev ? 'inline' : false,
|
|
lib: {
|
|
entry: r('src/contentScripts/index.ts'),
|
|
name: packageJson.name,
|
|
formats: ['iife'],
|
|
},
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: 'index.global.js',
|
|
extend: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
...sharedConfig.plugins!,
|
|
|
|
// https://github.com/antfu/vite-plugin-windicss
|
|
WindiCSS({
|
|
config: {
|
|
...windiConfig,
|
|
// disable preflight to avoid css population
|
|
preflight: false,
|
|
},
|
|
}),
|
|
],
|
|
})
|