Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
fix: disable inline optimization by default (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Jun 15, 2018
1 parent 3ca5eaf commit 6ab0918
Show file tree
Hide file tree
Showing 6 changed files with 454 additions and 327 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -164,8 +164,8 @@ Number of concurrent runs.
|**`warnings`**|`{Boolean}`|`false`|Display Warnings|
|**[`parse`](https://github.com/mishoo/UglifyJS2/tree/harmony#parse-options)**|`{Object}`|`{}`|Additional Parse Options|
|**[`compress`](https://github.com/mishoo/UglifyJS2/tree/harmony#compress-options)**|`{Boolean\|Object}`|`true`|Additional Compress Options|
|**[`mangle`](https://github.com/mishoo/UglifyJS2/tree/harmony#mangle-options)**|`{Boolean\|Object}`|`true`|Enable Name Mangling (See [Mangle Properties](https://github.com/mishoo/UglifyJS2/tree/harmony#mangle-properties-options) for advanced setups, use with ⚠️)|
|**[`output`](https://github.com/mishoo/UglifyJS2/tree/harmony#output-options)**|`{Object}`|`{}`|Additional Output Options (The defaults are optimized for best compression)|
|**[`mangle`](https://github.com/mishoo/UglifyJS2/tree/harmony#mangle-options)**|`{Boolean\|Object}`|`{inline: false}`|Enable Name Mangling (See [Mangle Properties](https://github.com/mishoo/UglifyJS2/tree/harmony#mangle-properties-options) for advanced setups, use with ⚠️)|
|**[`output`](https://github.com/mishoo/UglifyJS2/tree/harmony#output-options)**|`{Object}`|`{comments: extractComments ? false : /^\**!|@preserve|@license|@cc_on/,}`|Additional Output Options (The defaults are optimized for best compression)|
|**`toplevel`**|`{Boolean}`|`false`|Enable top level variable and function name mangling and to drop unused variables and functions|
|**`nameCache`**|`{Object}`|`null`|Enable cache of mangled variable and property names across multiple invocations|
|**`ie8`**|`{Boolean}`|`false`|Enable IE8 Support|
Expand Down
3 changes: 3 additions & 0 deletions src/index.js
Expand Up @@ -42,6 +42,9 @@ class UglifyJsPlugin {
include,
exclude,
uglifyOptions: {
compress: {
inline: 1,
},
output: {
comments: extractComments ? false : /^\**!|@preserve|@license|@cc_on/,
},
Expand Down
9 changes: 5 additions & 4 deletions src/uglify/minify.js
Expand Up @@ -21,17 +21,18 @@ const buildUglifyOptions = ({
} = {}) => ({
ecma,
warnings,
parse,
compress,
mangle: mangle == null ? true : mangle,
parse: { ...parse },
compress: typeof compress === 'boolean' ? compress : { ...compress },
// eslint-disable-next-line no-nested-ternary
mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : { ...mangle },
output: {
shebang: true,
comments: false,
beautify: false,
semicolons: true,
...output,
},
// Ignoring sourcemap from options
// Ignoring sourceMap from options
sourceMap: null,
toplevel,
nameCache,
Expand Down

0 comments on commit 6ab0918

Please sign in to comment.