-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
36 lines (34 loc) · 1014 Bytes
/
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
import minify from 'rollup-plugin-babel-minify';
import cjs from 'rollup-plugin-commonjs';
import copy from 'rollup-plugin-copy';
import nodeGlobals from 'rollup-plugin-node-globals';
import nodeResolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript2';
function createConfig(folder) {
return {
input: `./${folder}/index.ts`,
output: {
file: `dist/${folder}/index.js`,
format: 'iife',
sourcemap: true,
},
plugins: [
nodeGlobals(),
nodeResolve({
jsnext: true,
main: true
}),
cjs(),
typescript(),
copy({
[`${folder}/index.html`]: `dist/${folder}/index.html`,
'node_modules/@webcomponents': 'dist/node_modules/@webcomponents'
}),
minify({ comments: false })
]
};
}
export default [
'todo',
'unit-converter'
].map(createConfig);