-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
having multiple instances of this plugin seems to prevent webpack from emitting any files other than the manifests #100
Comments
Interesting... I wonder if it's due to: https://github.com/danethurber/webpack-manifest-plugin/blob/409b0fb64234ed9fa9adeeba31850a4d4feeca7c/lib/plugin.js#L173-L178 Could you send me a failing PR, please |
Not sure what you mean by a failing PR. Add a test to https://github.com/danethurber/webpack-manifest-plugin/blob/master/spec/plugin.integration.spec.js ? |
yes, or rather: spec/plugin.spec.js |
So I don't think I'm going to fix that I believe it's bad practice to have multiple instances of the same plugins (I could be wrong) But I think we can work around that: new ManifestPlugin([
{
fileName: 'manifest-android.json',
filter: (file)=>!file.path.match(/\.mp3$|\.map$/),
},
{
fileName: 'manifest-ios.json',
filter: (file)=>!file.path.match(/\.ogg$|\.map$/),
}
]) What do you think? |
I haven't seen anything that suggests it's bad practise to have multiple instances of the same plugin. |
Thank you for the I'm one of the maintainer of Anyway I will try to see if I can fix it (by allowing multiple instances), feel free to have a look on your side as well :) |
Why the |
The way to resolve that would be to have a lock per files rather than a lock per instance @BernsteinA Do you think you can have a look at it? |
Not sure that's the right approach here to be honest... After @BernsteinA example, I think supporting multiple instance is the best / less confusing |
Actually... I just changed my mind, I don't think we should solve this issue... We should only be supporting array options. It's the easiest way path and it will cause less issues If we ever removed the lock there would be another issue with multiple instances: a manifest file will reference the other one randomly, that's why I think we shouldn't fix that issue On top of the API docs, we should add an FAQ with @BernsteinA Interested in working on that? |
I think as well as adding to the readme, we should detect when there are multiple instances of the plugin, and throw an error instead of the current behavior which times out instead of fails.
I can definitely contribute to these solutions but can't commit to a timeline. Pretty swamped with work right now |
Yep, we could use
No worries, I think most of us are like that atm, I understand :) |
I was trying to generate a manifest for each type of resource (css, js, ...) and found this issue. |
@deguif No, not yet, I don't have that much time atm. But feel free to give it a go :) |
I got something working, I will try to push it tonight or tomorrow |
2.0.0-rc.1
with only one ManifestPlugin everything works. with two, no assets are emitted by webpack, except the two manifest jsons.
The text was updated successfully, but these errors were encountered: