-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
61 lines (58 loc) · 1.33 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
52
53
54
55
56
57
58
59
60
61
import { getBabelOutputPlugin } from '@rollup/plugin-babel';
import bundlesize from 'rollup-plugin-bundle-size';
import { terser } from 'rollup-plugin-terser';
const MAIN = 'src/index.js';
const MAIN_NAME = 'zuze';
const MAIN_OPERATORS = 'src/operators/index.js';
const MAIN_OPERATORS_NAME = 'zuze';
export default [
// BROWSER
{
input: MAIN,
output: [
{
file: 'build/browser.min.js',
sourcemap: true,
format: 'iife',
name: MAIN_NAME,
extend: true,
plugins: [
getBabelOutputPlugin({
allowAllFormats: true,
presets: [
[
'@babel/preset-env',
{ targets: { browsers: ['> 1%', 'last 2 versions'] } },
],
],
}),
terser(),
bundlesize(),
],
},
],
},
// BROWSER
{
input: MAIN_OPERATORS,
output: [
{
file: 'build/pipe.js',
sourcemap: true,
format: 'iife',
extend: true,
name: MAIN_OPERATORS_NAME,
plugins: [
getBabelOutputPlugin({
allowAllFormats: true,
presets: [
['@babel/preset-env', { targets: { browsers: ['> 1.5%'] } }],
],
}),
terser(),
bundlesize(),
],
},
],
},
];