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

Commit 6ab0918

Browse files
fix: disable inline optimization by default (#308)
1 parent 3ca5eaf commit 6ab0918

File tree

6 files changed

+454
-327
lines changed

6 files changed

+454
-327
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ Number of concurrent runs.
164164
|**`warnings`**|`{Boolean}`|`false`|Display Warnings|
165165
|**[`parse`](https://github.com/mishoo/UglifyJS2/tree/harmony#parse-options)**|`{Object}`|`{}`|Additional Parse Options|
166166
|**[`compress`](https://github.com/mishoo/UglifyJS2/tree/harmony#compress-options)**|`{Boolean\|Object}`|`true`|Additional Compress Options|
167-
|**[`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 ⚠️)|
168-
|**[`output`](https://github.com/mishoo/UglifyJS2/tree/harmony#output-options)**|`{Object}`|`{}`|Additional Output Options (The defaults are optimized for best compression)|
167+
|**[`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 ⚠️)|
168+
|**[`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)|
169169
|**`toplevel`**|`{Boolean}`|`false`|Enable top level variable and function name mangling and to drop unused variables and functions|
170170
|**`nameCache`**|`{Object}`|`null`|Enable cache of mangled variable and property names across multiple invocations|
171171
|**`ie8`**|`{Boolean}`|`false`|Enable IE8 Support|

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class UglifyJsPlugin {
4242
include,
4343
exclude,
4444
uglifyOptions: {
45+
compress: {
46+
inline: 1,
47+
},
4548
output: {
4649
comments: extractComments ? false : /^\**!|@preserve|@license|@cc_on/,
4750
},

src/uglify/minify.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ const buildUglifyOptions = ({
2121
} = {}) => ({
2222
ecma,
2323
warnings,
24-
parse,
25-
compress,
26-
mangle: mangle == null ? true : mangle,
24+
parse: { ...parse },
25+
compress: typeof compress === 'boolean' ? compress : { ...compress },
26+
// eslint-disable-next-line no-nested-ternary
27+
mangle: mangle == null ? true : typeof mangle === 'boolean' ? mangle : { ...mangle },
2728
output: {
2829
shebang: true,
2930
comments: false,
3031
beautify: false,
3132
semicolons: true,
3233
...output,
3334
},
34-
// Ignoring sourcemap from options
35+
// Ignoring sourceMap from options
3536
sourceMap: null,
3637
toplevel,
3738
nameCache,

0 commit comments

Comments
 (0)