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

fix: disable inline optimization by default #308

Merged
merged 1 commit into from Jun 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in option name

sourceMap: null,
toplevel,
nameCache,
Expand Down