Skip to content

Commit

Permalink
added uglify options
Browse files Browse the repository at this point in the history
  • Loading branch information
sasaplus1 committed May 3, 2018
1 parent 1b81714 commit ce8a569
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';
import uglifySaveLicense from 'uglify-save-license';

import meta from './package.json';

Expand All @@ -10,6 +11,11 @@ const banner = [
' * @license deepcopy.js Copyright(c) 2013 sasa+1',
' * https://github.com/sasaplus1/deepcopy.js',
' * Released under the MIT license.',
// TODO: type-detect licensing got from node_modules/type-detect/index.js with manual
' *',
' * type-detect',
' * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>',
' * MIT Licensed',
' */'
].join('\n');

Expand Down Expand Up @@ -42,6 +48,14 @@ const babelOptions = {
]
};

const uglifyOptions = {
output: {
// TODO: deepcopy.legacy.min.js has line comment
// `// 25.4.1.5 NewPromiseCapability(C)`
comments: uglifySaveLicense
}
};

export default [
{
input: './index.mjs',
Expand All @@ -68,7 +82,7 @@ export default [
nodeResolve(nodeResolveOptions),
commonjs(),
babel(babelOptions),
uglify()
uglify(uglifyOptions)
]
},
{
Expand All @@ -90,7 +104,11 @@ export default [
format: 'umd',
name: meta.name
},
plugins: [nodeResolve(nodeResolveOptions), commonjs(), uglify()]
plugins: [
nodeResolve(nodeResolveOptions),
commonjs(),
uglify(uglifyOptions)
]
},
{
input: './index.mjs',
Expand All @@ -111,6 +129,10 @@ export default [
format: 'es',
name: meta.name
},
plugins: [nodeResolve(nodeResolveOptions), commonjs(), uglify()]
plugins: [
nodeResolve(nodeResolveOptions),
commonjs(),
uglify(uglifyOptions)
]
}
];

0 comments on commit ce8a569

Please sign in to comment.