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