-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.js
37 lines (34 loc) · 1.05 KB
/
vite.config.js
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
/** @type {import('vite').UserConfig} */
import {defineConfig, splitVendorChunkPlugin} from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
import {writeManifest} from "./plugins/writeManifest.js";
import manifest from "./src/manifest.json";
const noHashNames = [
'contentScript',
'injectedScript',
'serviceWorker',
];
export default defineConfig({
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
panel: resolve(__dirname, 'panel.html'),
injectedScript: resolve(__dirname, 'src/Injection/index.ts'),
contentScript: resolve(__dirname, 'src/contentScript.ts'),
serviceWorker: resolve(__dirname, 'src/serviceWorker.ts'),
},
output: {
entryFileNames: (chunkInfo) => {
if (noHashNames.includes(chunkInfo.name)) {
return '[name].js';
} else {
return '[name].[hash].js'
}
},
},
},
},
plugins: [react(), writeManifest(manifest), splitVendorChunkPlugin()]
})