forked from facebook/Rapid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.legacy.js
47 lines (42 loc) · 1.23 KB
/
rollup.config.legacy.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
/* eslint-disable no-console */
import babel from '@rollup/plugin-babel';
import commonjs from '@rollup/plugin-commonjs';
import includePaths from 'rollup-plugin-includepaths';
import json from '@rollup/plugin-json';
import progress from 'rollup-plugin-progress';
import nodeResolve from '@rollup/plugin-node-resolve';
// The "legacy" build includes all modules in a single bundle:
// * Runs `buble` to transpile ES6 -> ES5 (needed for IE11 and PhantomJS)
// * No sourcemaps
export default {
input: './modules/id.js',
onwarn: onWarn,
output: {
file: 'dist/iD.legacy.js',
format: 'iife',
sourcemap: false,
strict: false
},
plugins: [
progress(),
includePaths({
paths: ['node_modules/d3/node_modules'] // npm2 or windows
}),
nodeResolve({ dedupe: ['object-inspect'] }),
commonjs(),
json({ indent: '' }),
babel({
babelHelpers: 'bundled',
// avoid circular dependencies due to `useBuiltIns: usage` option
exclude: [/\/core-js\//]
})
]
};
function onWarn(warning, warn) {
// skip certain warnings
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
if (warning.code === 'EVAL') return;
// Use default for everything else
console.log(warning.code);
warn(warning);
}