This repository has been archived by the owner on Dec 5, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 182
Expose chunk to options.<test|include|exclude>
#21
Comments
michael-ciniawsky
changed the title
Expose chunk to test/include/exclude
feat: expose chunk to Jul 4, 2017
options.<test|include|exclude>
@japgolly How about this for usage: new UglifyJsPlugin ({
// same as current behavior, would convert old syntax to this for legacy support.
assets: {
test: /uglify-me-with-ecma-5.js/,
exclude: path.resolve(__dirname, '../src/dont-uglify-me-bro'),
options: {// override the plugin uglifyOptions per match!
ecma: 5
}
},
modules: {
include: /uglify-me-with-ecma-8.js/,
options: {
ecma: 8
}
// also accepts test/exclude
},
uglifyOptions: {
ecma: 7
}
}); and/or: new UglifyJsPlugin ({
assets: [
{
test: /uglify-me-with-ecma-5.js$/,
exclude: path.resolve(__dirname, '../src/dont-uglify-me-bro'),
options: { ecma: 5 }
},
{
test: /uglify-me-with-ecma-5.js$/,
exclude: path.resolve(__dirname, '../src/dont-uglify-me-bro'),
options: { ecma: 5 }
},
]
modules: [
{
include: /uglify-me-with-ecma-8.js$/,
options: { ecma: 8 }
},
{
include: /uglify-me-with-ecma-8.js$/,
options: { ecma: 8 }
},
],
uglifyOptions: {
ecma: 7
}
}); and/or: new UglifyJsPlugin ({
modules(module) (
if (module.resource.indexOf('uglify-me-bro.js') > -1) {
return { ecma: 8 }; // can return boolean or object
}
return true;
),
assets(file) (
return file.indexOf('plssss-uglify-me.js') > -1;
),
uglifyOptions: {
ecma: 7
}
}); and/or: new UglifyJsPlugin ({
assets: /plssss-uglify-me.js$/,
uglifyOptions: {
ecma: 7
}
}); I think this offers the finest grain of control. |
michael-ciniawsky
changed the title
feat: expose chunk to
Expose chunk to Nov 10, 2017
options.<test|include|exclude>
options.<test|include|exclude>
I have created a loader for javascript-obfuscator, and I would like to avoid uglifyjs-webpack-plugin to process resources that pass through that loader (because obfuscated code must not be uglified). I would like to use something like:
|
6 tasks
+1 |
Will be shipped in near future |
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The
test
,include
andexclude
options only inspect the output filename, which has no value when the names are like[hash].[ext]
. It would be very helpful to expose the associated chunk info as well.The text was updated successfully, but these errors were encountered: