Open AndyOGo opened 7 years ago
Hi! You mean to be able to generate unminified files in parallel?
@w0rse Hi, yes exactly, but without having webpack being run twice, just in one go.
unminified-webpack-plugin checks for the presence of the UglifyJsPlugin in the configuration with an instanceof test.
I worked around this by doing the following:
const UglifyJsParallelPlugin = require('webpack-uglify-parallel');
UglifyJsParallelPlugin.prototype = Object.assign(new webpack.optimize.UglifyJsPlugin(), UglifyJsParallelPlugin.prototype);
Looks a bit hacky :) We should work with unminified-webpack-plugin author to remove the strong check for UglifyJsPlugin.
Conceptually, extending UglifyJsPlugin makes sense. The difficulty is that its not designed/executed in a friendly way to support this. If they broke up the monolithic apply() into smaller pieces, you could easily reuse what they already offer without duplication. My workaround effectively overrides the bulk of the code of the original, but makes the type checking happy.
How about compatability/support for unminified-webpack-plugin?