Open suanmei opened 5 years ago
This plugin is able to transform only bundles, not specific files. So these options just doesn't make sense. As a solution you may use condition
[
...
condition && uglify()
...
]
yeah,I just want to specify the bundle like that
uglify({
include: '/\.min\.js$/'
})
This is too simple for you to add two apis
transformBundle(code, options) {
yourFunc(options.file)
...
...
}
This won't work if chunk names are autogenerated
I think I would accept this feature. Could you prepare a PR?
Completely fine
UglifyJs can‘t accept options other than the one it specifies, so ---
do you want me to change your options format like that
{
include: /\/includes/,
exclude: /\/exclude/,
uglifyOptions: {} // uglifyJS API options
}
and change the version to 7.0.0, so it won't affect the previous users
or
let me do some compatibility with versions prior to 6.0.0 and 6.0.0, such as removing include
and exclude
before passing options to uglifyJS, which is not conducive to extending new features in the future.
I looked at the latest documentation. If you don't specify a filename, it won't automatically generate a new filename, but instead output it directly to the command line tool.
@TrySound look forward to your reply
I set sourceMap to undefined
, look at the code
I want to generate two versions of the file
So I need it to let me choose to compress or not compress for a file by
include
orexclude
Just like uglifyjs-webpack-plugin