I really hate this code:
|
const isUsingHtmlWebpackPlugin = HtmlWebpackPlugin != null && compiler.options.plugins.some(x => x instanceof HtmlWebpackPlugin); |
|
|
|
if (isUsingHtmlWebpackPlugin) { |
|
this.applyHtmlWebpackPlugin(compiler); |
|
} else { |
|
this.applyWebpackCore(compiler); |
|
} |
It's working but for the user it can be very surprising and I don't think it can be extended extensively to handle different output plugin (like #31 )
I think a better API would be to expose multiple constructor like (better name ?):
DynamicCdnWebpackPlugin
DynamicCdnWebpackPLuginForHtmlPlugin
DynamicCdnWebpackPluginForAssetsPlugin
- ...
DynamicCdnWebpackPLuginForHtmlPlugin would extend DynamicCdnWebpackPLugin and would override the output function
@aulisius What do you think? Do you have any other suggestion?
I really hate this code:
dynamic-cdn-webpack-plugin/src/index.js
Lines 51 to 57 in ba58d17
It's working but for the user it can be very surprising and I don't think it can be extended extensively to handle different output plugin (like #31 )
I think a better API would be to expose multiple constructor like (better name ?):
DynamicCdnWebpackPluginDynamicCdnWebpackPLuginForHtmlPluginDynamicCdnWebpackPluginForAssetsPluginDynamicCdnWebpackPLuginForHtmlPluginwould extendDynamicCdnWebpackPLuginand would override the output function@aulisius What do you think? Do you have any other suggestion?