-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Propostion] New API to instantiate plugin for diff supported output plugin #50
Comments
I like the idea. We can work on the naming but this is interesting. Currently, it is not possible to use Personally, not a huge fan of inheritance, is something like this too verbose? import DynamicCdn, { withAssetsPlugin } from 'dynamic-cdn-webpack-plugin';
export default {
context: path.resolve(__dirname, './app'),
output: {
publicPath: '',
path: path.resolve(__dirname, './lib')
},
entry: {
app: './app.js'
},
plugins: [
new AssetsPlugin({
filename: 'assets.json',
useCompilerPath: true
}),
new DynamicCdn({ output: withAssetsPlugin })
]
} where |
I'm not sure. I don't think we should let users have access to webpack internals I understand you are not a fan of inheritance, to me as long as there is only one level, I'm happy |
I concur with the fact that we shouldn't be exposing webpack internals to users. Cool, let's go with the multiple classes approach then. I am okay with inheritance to a certain degree :P |
@aulisius Cool, I will try to work on that this week-end Any thoughts on the names?
|
The names are giving me Java nightmares O_O.
I'm cool with this because it's the shortest but like is mentioning Webpack really necessary? The package name already has |
This would be a well received improvement. |
Needs a little work, but it's a start. |
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 ?):
DynamicCdnWebpackPlugin
DynamicCdnWebpackPLuginForHtmlPlugin
DynamicCdnWebpackPluginForAssetsPlugin
DynamicCdnWebpackPLuginForHtmlPlugin
would extendDynamicCdnWebpackPLugin
and would override the output function@aulisius What do you think? Do you have any other suggestion?
The text was updated successfully, but these errors were encountered: