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

Background-image path map can't be generated in manifest.json #189

Closed
roadwild opened this issue Jun 29, 2019 · 3 comments
Closed

Background-image path map can't be generated in manifest.json #189

roadwild opened this issue Jun 29, 2019 · 3 comments

Comments

@roadwild
Copy link

Hi!

I have created a repo to reproduce the problem, address is https://github.com/sinkinlife/webpack-demo/tree/master

issues description:
I introduced multiple images in the vue component through background, but found that the manifest.json generated by webpack-manifest-plugin only has a mapping of the first image of each vue component

mycode:
.icon { &.terrible { background: url('../../images/icon_zaogaob.png') no-repeat; } &.worse { background: url('../../images/icon_jiaochab.png') no-repeat; } &.general { background: url('../../images/icon_yibanb.png') no-repeat; } &.satisfaction { background: url('../../images/icon_manyib.png') no-repeat; } &.well { background: url('../../images/icon_chaozanb.png') no-repeat; } }
.delete { background: url('../../images/delete.png') no-repeat; } .add { background: url('../../images/camera.png') no-repeat; }

manifest.json
{ "app.js": "scripts/app.93f159d46b2ced4eb0a5.js", "styles/1.282556c48ba0a1f16230.css": "styles/1.282556c48ba0a1f16230.css", "scripts/1.b3859898404b7e35f17f.js": "scripts/1.b3859898404b7e35f17f.js", "assets/appraise/js/images/index.vue?vue&type=style&index=0&id=9ec7926a&lang=scss&scoped=true&": "assets/appraise/js/images/delete.cafa4d9efe6e8187e0ea71cc70eed8ba.png", "assets/appraise/js/images/index.vue?vue&type=style&index=0&id=4dcb8fd0&lang=scss&scoped=true&": "assets/appraise/js/images/icon_zaogaob.a6842408db5bc90215366ea6d88fe086.png" }

Some things I found:

  1. After removing the mini-css-extract-plugin, all images are mapped in manifest.json

Do you know why this happens?

@huzhongchun
Copy link

I have same problem! @mastilver

@roadwild
Copy link
Author

I have same problem! @mastilver

Try to rewrite generate function to solve your problem

@shellscape
Copy link
Owner

This is related to the problem described in #167 and should be resolved once that's fixed.

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