-
Notifications
You must be signed in to change notification settings - Fork 115
/
rollup.config.js
50 lines (50 loc) · 1.31 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
// Rollup plugins
import babel from '@rollup/plugin-babel';
import eslint from '@rollup/plugin-eslint';
import replace from '@rollup/plugin-replace';
import { terser } from 'rollup-plugin-terser';
export default {
input: 'src/jmuxer.js',
output: [
{
file: 'example/jmuxer.min.js',
format: 'umd',
name: 'JMuxer',
sourcemap: false, // 'inline'
globals: {
stream: 'stream',
fs: 'fs'
}
},
{
file: 'dist/jmuxer.min.js',
format: 'umd',
name: 'JMuxer',
sourcemap: false,
globals: {
stream: 'stream',
fs: 'fs'
}
}
],
onwarn: function ( message ) {
if (message.code === 'MISSING_NODE_BUILTINS') {
return;
}
console.error(message);
},
plugins: [
eslint(),
babel({
exclude: 'node_modules/**',
babelHelpers: 'bundled'
}),
replace({
exclude: 'node_modules/**',
preventAssignment: true,
ENV: JSON.stringify(process.env.NODE_ENV || 'development'),
}),
(process.env.NODE_ENV === 'production' && terser()),
],
external: [ 'stream', 'fs' ],
};