-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
45 lines (43 loc) · 1.15 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
import bundleSize from 'rollup-plugin-bundle-size';
import terser from '@rollup/plugin-terser';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonJS from '@rollup/plugin-commonjs';
import svg from 'rollup-plugin-svg';
import postcss from 'rollup-plugin-postcss';
import json from '@rollup/plugin-json';
function onwarn(warning, defaultHandler) {
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
defaultHandler(warning);
}
}
export default [
{
input: 'src/index.js',
plugins: [
bundleSize(),
nodeResolve({ browser: true }),
commonJS({
include: 'node_modules/**'
}),
svg(),
postcss({ extensions: ['.css'] }),
json()
],
onwarn,
output: [
{
file: 'dist/divi.mjs',
format: 'es'
},
{
file: 'dist/divi.min.js',
format: 'umd',
sourcemap: true,
plugins: [
terser({ ecma: 2018 })
],
name: 'divi'
}
]
}
];