-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
46 lines (44 loc) · 1005 Bytes
/
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
import { defineConfig } from "vite";
import { resolve } from "path";
import minifyHTML from "rollup-plugin-minify-html-literals";
// TODO: auto remove console.log from build
// TODO: improve how docs are generated
// https://vitejs.dev/config/
export default defineConfig({
esbuild: {
// drop: ["console", "debugger"],
},
build: {
sourcemap: true,
modulePreload: {
polyfill: false,
},
rollupOptions: {
input: {
index: resolve(__dirname, "index.html"),
"theme-multi-switch": resolve(__dirname, "./src/main.ts"),
},
output: [
// {
// entryFileNames: "[name].js",
// },
{
entryFileNames: "[name].js",
dir: "docs",
},
],
plugins: [
minifyHTML.default({
options: {
shouldMinify(template) {
return template.parts.some((part) => {
// Matches Polymer templates that are not tagged
return part.text.includes("<style") || part.text.includes("<div");
});
},
},
}),
],
},
},
});