Skip to content
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

Invalid manifest with the latest mini-css-extract-plugin #39

Closed
renchap opened this issue Sep 20, 2018 · 8 comments
Closed

Invalid manifest with the latest mini-css-extract-plugin #39

renchap opened this issue Sep 20, 2018 · 8 comments
Assignees

Comments

@renchap
Copy link

renchap commented Sep 20, 2018

After updating mini-css-extract-plugin from 0.4.2 to 0.4.3, the manifest is no longer valid.
Assets referenced via the CSS are missing, and some assets are pointing to unrelated paths. For example (from the issue below):

With 0.4.2:
"images/create/wallet.png": "images/create/wallet.png"

With 0.4.3
"images/create/Create.scss": "images/create/wallet.png"

See webpack-contrib/mini-css-extract-plugin#177 (comment)

According to @evilebottnawi this is a problem with the manifest plugin, not the referenced change.

@webdeveric
Copy link
Owner

@renchap I'm using module.userRequest to get the original filename and it is wrong when using mini-css-extract-plugin 0.4.3. Its fine in 0.4.2 and below. Its being set to the css file instead of the asset (bg image, font, etc.). The other loaders I'm using have the expected value for module.userRequest.

I tried another webpack manifest plugin and I get the same result. This issue is not isolated to my plugin.

@piecyk
Copy link

piecyk commented Sep 22, 2018

@webdeveric had a quick look, maybe this approach is better? It looks like it fixes the issue also all your test pass 🤔 IMHO using module.identifier() is much safer, what do you think ?

piecyk@2e07ad9

@piecyk
Copy link

piecyk commented Sep 22, 2018

Hmm maybe even simpler, only set name and originalName when extensions match

piecyk@5dcba5c

@webdeveric
Copy link
Owner

@piecyk I'm trying it out locally. It looks promising.

@webdeveric
Copy link
Owner

@renchap I have a fix in my dev branch.

Can you try it out and let me know how it works for you?

npm install https://github.com/webdeveric/webpack-assets-manifest.git#dev

@renchap
Copy link
Author

renchap commented Sep 26, 2018

Seems to work fine for me! 👍

@webdeveric
Copy link
Owner

@renchap The updated version has been published to npm.

@piecyk
Copy link

piecyk commented Sep 26, 2018

Good work @webdeveric 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants