-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrollup.config.js
More file actions
41 lines (39 loc) · 1.02 KB
/
rollup.config.js
File metadata and controls
41 lines (39 loc) · 1.02 KB
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
import { terser } from 'rollup-plugin-terser';
import babel from '@rollup/plugin-babel';
import replace from 'rollup-plugin-replace';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import pkg from './package.json';
const DEV = !!process.env.ROLLUP_WATCH;
const ENV = DEV ? 'development' : 'production';
const VERSION = `"${pkg.version}"`;
export default [
{
input: 'src/index.js',
output: [{
name: 'Numl Utils',
dir: `./dist/`,
format: 'es',
}],
plugins: [
babel({
plugins: [
'@babel/plugin-proposal-object-rest-spread',
],
exclude: /node_modules/,
babelHelpers: 'bundled',
}),
replace({
'process.env.NODE_ENV': JSON.stringify(ENV),
'process.env.APP_VERSION': VERSION,
}),
resolve({
extensions: ['.jsx', '.js'],
}),
commonjs(),
json(),
ENV === 'development' ? undefined : terser(),
]
}
];