Closed roadwild closed 3 years ago
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; }
.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" }
{ "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:
Do you know why this happens?
I have same problem! @mastilver
Try to rewrite generate function to solve your problem
This is related to the problem described in #167 and should be resolved once that's fixed.
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:
Do you know why this happens?