-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.content.config.ts
More file actions
32 lines (31 loc) · 869 Bytes
/
vite.content.config.ts
File metadata and controls
32 lines (31 loc) · 869 Bytes
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
import { defineConfig } from 'vite';
import { resolve } from 'path';
// Separate config for content script - must be IIFE format for Chrome extension
export default defineConfig({
build: {
outDir: 'dist',
sourcemap: process.env.NODE_ENV !== 'production',
minify: 'esbuild',
target: 'es2020',
emptyOutDir: false, // Don't clear the dist folder (main build already created it)
lib: {
entry: resolve(__dirname, 'src/content/content.ts'),
name: 'GraphitiContent',
formats: ['iife'],
fileName: () => 'content.js',
},
rollupOptions: {
output: {
// Ensure all code is inlined (no external imports)
inlineDynamicImports: true,
// Make sure globals don't conflict
extend: true,
},
},
},
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
});