-
Notifications
You must be signed in to change notification settings - Fork 50
/
rollup.config.js
55 lines (54 loc) · 1.35 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
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import babel from 'rollup-plugin-babel'
import { uglify } from 'rollup-plugin-uglify'
import pkg from './package.json'
// Based off https://github.com/rollup/rollup-starter-lib/tree/de859333cf41b94dc7d434882e56798d9fa9c731
export default [
{
input: 'src/flux-angular.js',
external: ['angular'],
output: {
globals: {
angular: 'angular',
},
file: pkg.unpkg,
format: 'umd',
name: 'fluxAngular',
sourcemap: true,
},
plugins: [
// Resolve and include dependencies in the bundle
resolve({ browser: true }),
commonjs(),
babel({
exclude: ['node_modules/**'],
presets: [
// Include pollyfills for older browsers in the umd build only
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
loose: true,
},
],
],
}),
uglify(),
],
},
{
input: 'src/flux-angular.js',
external: ['angular', 'baobab', 'dispatchr'],
output: [
{ file: pkg.main, format: 'cjs', sourcemap: true },
{ file: pkg.module, format: 'es', sourcemap: true },
],
plugins: [
babel({
exclude: ['node_modules/**'],
}),
],
},
]