-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
41 lines (39 loc) · 1.34 KB
/
vite.config.js
File metadata and controls
41 lines (39 loc) · 1.34 KB
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
import { defineConfig } from "vite"
import { resolve } from "path"
import { fileURLToPath } from "url"
import { dirname } from "path"
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
export default defineConfig({
build: {
rollupOptions: {
input: {
// Main popup entry point
main: resolve(__dirname, "index.html"),
// Content script entry point
content: resolve(__dirname, "src/content.js"),
// Injected script for page context
inject: resolve(__dirname, "src/inject.js"),
twind: resolve(__dirname, "src/twind.js")
},
output: {
// Ensure content script, inject script, and twind are output with correct names
entryFileNames: (chunkInfo) => {
if (chunkInfo.name === "content") return "content.js"
if (chunkInfo.name === "inject") return "inject.js"
if (chunkInfo.name === "twind") return "twind.js"
return "[name]-[hash].js"
},
// Keep chunks separate for browser extension
chunkFileNames: "[name]-[hash].js",
assetFileNames: "[name]-[hash][extname]"
}
},
// Don't minify for easier debugging (optional)
minify: false,
// Ensure source maps for debugging
sourcemap: true
},
// Copy public folder contents to dist
publicDir: "public"
})