-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathvite.config.ts
50 lines (49 loc) · 1.35 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
50
import { defineConfig } from "vite";
import { resolve } from "path";
import minifyHTML from "rollup-plugin-minify-html-literals";
import eslint from "vite-plugin-eslint";
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
return {
esbuild: {
drop: mode === "production" ? ["console", "debugger"] : [],
},
build: {
sourcemap: true,
modulePreload: {
polyfill: false,
},
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
index: resolve(__dirname, "src/main.ts"),
"action-table": resolve(__dirname, "src/action-table.ts"),
"action-table-filters": resolve(__dirname, "src/action-table-filters.ts"),
"action-table-pagination": resolve(__dirname, "src/action-table-pagination.ts"),
"action-table-switch": resolve(__dirname, "src/action-table-switch.ts"),
},
output: [
{
entryFileNames: `[name].js`,
assetFileNames: `action-table.[ext]`,
dir: "dist",
},
],
plugins: [
eslint(),
// @ts-expect-error types are missing
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");
});
},
},
}),
],
},
},
};
});