forked from ranile/material-yew
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
51 lines (48 loc) · 1.14 KB
/
rollup.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { nodeResolve } from '@rollup/plugin-node-resolve';
import { terser } from "rollup-plugin-terser";
const COMPONENTS = [
"button",
"circular-progress",
"checkbox",
"circular-progress-four-color",
"drawer",
"top-app-bar",
"icon-button",
"fab",
"formfield",
"linear-progress",
"icon",
"radio",
"switch",
"top-app-bar-fixed",
"dialog",
"list",
"list/mwc-list-item",
"list/mwc-check-list-item",
"list/mwc-radio-list-item",
"icon-button-toggle",
"slider",
"tab",
"tab-bar",
"snackbar",
"textfield",
"textarea",
"select",
"menu",
];
export default {
input: COMPONENTS.map((component) => `@material/mwc-${component}`),
plugins: [nodeResolve(), terser({ format: { comments: false } })],
output: {
dir: `material-yew/build`,
chunkFileNames: "[name].js",
manualChunks: (id, { getModuleInfo }) => {
const info = getModuleInfo(id);
if (info.importers.length <= 1) {
// This will be inlined anyway
return;
}
return "core";
},
},
};