-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
42 lines (40 loc) · 1.05 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
37
38
39
40
41
42
//@ts-ignore
import vue from "@vitejs/plugin-vue";
import { join, parse, resolve } from "path";
export default {
plugins: [
vue(),
],
resolve: {
alias: [
{ find: '@', replacement: resolve(__dirname, 'src') },
],
},
publicDir: 'public',
build: {
outDir: join(__dirname, "dist"),
rollupOptions: {
input: entryPoints(
"interface.html",
"popup.html",
"panel.html",
),
output: {
entryFileNames: 'ogs_[name].js',
chunkFileNames: 'ogs_[name].js',
assetFileNames: 'ogs_[name][extname]',
},
},
},
};
function entryPoints(...paths) {
const entries = paths.map(parse).map(entry => {
const { dir, base, name, ext } = entry;
const key = join(dir, name);
const path = resolve(__dirname, dir, base);
return [ key, path ];
});
const config = Object.fromEntries(entries);
console.log(config);
return config;
}