Skip to content

Commit

Permalink
changed uglify options
Browse files Browse the repository at this point in the history
2 changes here:  

1. i think `compressor` should be `compress`. i'm not sure if both work or not, but the (webpack docs)[http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin] say `compress`

2. `UglifyJS` unescapes `\u0000` and other unicode char code strings and converts them . this results in some libraries (`eg, `js-base64`, `firebase`) getting screwed up, and Chrome refusing to load the extension b/c the `injection` isn't `utf-8`. 

i hit that problem today and have been researching it. i could be wrong, but wanted to put in a PR to see what you thought

there's a `couchDB` bug that briefly explains it [here](pouchdb/pouchdb#5798)

the post that discusses the solution is on the `uglify` [repo here](mishoo/UglifyJS#490)
  • Loading branch information
brandonmp authored Oct 31, 2016
1 parent 471f28c commit 2a5ea36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions webpack/base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ const baseConfig = ({ input, output = {}, globals = {}, plugins, loaders }) => (
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
comments: false,
compressor: {
compress: {
warnings: false
}
},
output: {
ascii_only: true,
beautify: false,
}
})
])
],
Expand Down

0 comments on commit 2a5ea36

Please sign in to comment.