forked from smartcodeltd/mocha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
50 lines (41 loc) · 1.08 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
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import json from '@rollup/plugin-json';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import {babel} from '@rollup/plugin-babel';
// Debugging tools
import visualizer from 'rollup-plugin-visualizer';
import pickFromPackageJson from './scripts/pick-from-package-json';
const config = {
input: './browser-entry.js',
output: [
{
file: './mocha.js',
format: 'iife',
sourcemap: true
}
],
plugins: [
json(),
pickFromPackageJson({
keys: ['name', 'version', 'homepage', 'notifyLogo']
}),
commonjs(),
globals(),
builtins(),
nodeResolve({
browser: true
}),
babel({presets: ['@babel/preset-env'], babelHelpers: 'bundled'})
],
onwarn: (warning, warn) => {
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
// Use default for everything else
warn(warning);
}
};
if (!process.env.CI) {
config.plugins.push(visualizer());
}
export default config;