forked from paularmstrong/normalizr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rollup.config.js
28 lines (25 loc) · 904 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
import babel from 'rollup-plugin-babel';
import filesize from 'rollup-plugin-filesize';
import uglify from 'rollup-plugin-uglify';
import { minify } from 'uglify-es';
import { name } from './package.json';
const isProduction = process.env.NODE_ENV === 'production';
const destBase = 'dist/normalizr';
const destExtension = `${isProduction ? '.min' : ''}.js`;
export default {
input: 'src/index.js',
output: [
{ file: `${destBase}${destExtension}`, format: 'cjs' },
{ file: `${destBase}.es${destExtension}`, format: 'es' },
{ file: `${destBase}.umd${destExtension}`, format: 'umd', name },
{ file: `${destBase}.amd${destExtension}`, format: 'amd', name },
{ file: `${destBase}.browser${destExtension}`, format: 'iife', name }
],
plugins: [
babel({
plugins: ['external-helpers']
}),
isProduction && uglify({}, minify),
filesize()
].filter(Boolean)
};