forked from jsillitoe/react-currency-input
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rollup.config.js
37 lines (33 loc) · 939 Bytes
/
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
import buble from 'rollup-plugin-buble';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import peerDeps from 'rollup-plugin-peer-deps-external';
const format = process.env.NODE_ENV;
const isUmd = format === 'umd';
const file = `lib/react-currency-input.${isUmd ? 'min' : format}.js`
const config = {
input: './src/index.js',
name: 'react-currency-input',
sourcemap: true,
output: {
file,
format,
},
plugins: [
peerDeps(),
resolve({
jsnext: true,
main: true,
browser: true,
}),
buble({
objectAssign: 'Object.assign',
exclude: ['node_modules/**'],
}),
commonjs(),
],
};
isUmd && config.plugins.push(uglify(), filesize());
export default config;