Skip to content

Commit

Permalink
Merge pull request #36 from arichiardi/no-predicate-mangle
Browse files Browse the repository at this point in the history
Add reserved mangle option for js.spec predicates
  • Loading branch information
arichiardi committed Aug 1, 2017
2 parents 010fa93 + b8a6a5c commit c114d22
Show file tree
Hide file tree
Showing 4 changed files with 376 additions and 25 deletions.
2 changes: 1 addition & 1 deletion dist/js.spec.bundle.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -37,8 +37,8 @@
"mocha": "^3.1.2",
"nodemon": "^1.11.0",
"pretty-format": "^18.0.0",
"uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",
"uglifyjs-webpack-plugin": "0.4.6",
"uglify-js": "3",
"uglifyjs-webpack-plugin": "1.0.0-beta.2",
"webpack": "2.1.0-beta.25"
},
"dependencies": {
Expand Down
25 changes: 23 additions & 2 deletions webpack.config.js
Expand Up @@ -3,6 +3,23 @@ const path = require('path')
const node_modules = fs.readdirSync('node_modules')

const uglifyJSPlugin = require('uglifyjs-webpack-plugin');
const uglifyJSOptions = {
mangle: {
reserved: [
"isArray",
"isNumber",
"isFunction",
"isObject",
"isSet",
"isBoolean",
"isDate",
"isInteger",
"isString",
"isSymbol",
"isNil"
]
}
};

module.exports = [{
// node library
Expand Down Expand Up @@ -31,7 +48,9 @@ module.exports = [{
}]
},
plugins: [
new uglifyJSPlugin()
new uglifyJSPlugin({
uglifyOptions: uglifyJSOptions
})
]
}, {
// <script>
Expand Down Expand Up @@ -59,6 +78,8 @@ module.exports = [{
}]
},
plugins: [
new uglifyJSPlugin()
new uglifyJSPlugin({
uglifyOptions: uglifyJSOptions
})
]
}]

0 comments on commit c114d22

Please sign in to comment.