/
vite.config.ts
49 lines (46 loc) · 1.18 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
43
44
45
46
47
48
49
import { fileURLToPath, URL } from "node:url";
import { defineConfig } from "vite";
import vue2 from "@vitejs/plugin-vue2";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue2()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
/*
* SCSS rewrites
*/
"~bootstrap": fileURLToPath(
new URL("./node_modules/bootstrap", import.meta.url)
),
"~bootstrap-vue": fileURLToPath(
new URL("./node_modules/bootstrap-vue", import.meta.url)
),
"~vue-select": fileURLToPath(
new URL("./node_modules/vue-select", import.meta.url)
),
},
},
build: {
rollupOptions: {
input: {
tooltip: "src/tooltip/main.ts", // Tooltip, can be used on its own.
app: "index.html", // Standalone and embeddable application.
},
output: {
// Remove hashes from file name for easier manual inclusion.
entryFileNames: "[name].js",
assetFileNames: (chunkInfo) => {
// use filenames consistent with entry point
if (chunkInfo.name == "main.css") {
return "tooltip.css";
}
if (chunkInfo.name == "index.css") {
return "app.css";
}
return "[name][extname]";
},
},
},
},
});