-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvite.config.ts
36 lines (35 loc) · 1.07 KB
/
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
36
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'node:path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
minify: false,
outDir: 'dist',
assetsDir: '.', // output assets into the root of outDir
rollupOptions: {
// Custom Rollup configuration
input: {
// Specify entries for your files here
'service-worker': 'src/service-worker.ts',
'content-script': 'src/content-script.ts',
// Add other entry points if needed
index: 'index.html'
},
output: {
// Preserve specific file names
format: 'es',
// Override the filenames for service-worker.ts and content-script.ts
entryFileNames: '[name].js', // or whatever format you prefer
chunkFileNames: '[name]-[hash].js', // include hash for other chunks
assetFileNames: '[name]-[hash][extname]', // include hash for assets
},
},
},
})