-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Source map is incorrect when url()'s is rewrited #379
Comments
I now see, here we've got the following css (as json): ".d1{background:url(___CSS_LOADER_URL___0___)}.d2{width:20px}" and mappings:
which are totally correct. You must already see, where this is coming. Now then, this block changes css from ".d1{background:url(___CSS_LOADER_URL___0___)}.d2{width:20px}" to ".d1{background:url(" + require("./1.png") + ")}.d2{width:20px}" which then gets replaced with |
Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks! |
@evilebottnawi Yeah, I can reproduce it with
.d1 {
background: url(1.png);
}
.d2 {
width: 20px;
height: 20px;
}
.d3 {
width: 30px;
height: 30px;
}
.d4 {
width: 40px;
height: 40px;
} The thing is here we get totally valid source map: .d1{background:url(___CSS_LOADER_URL___0___)}.d2{width:20px;height:20px}.d3{width:30px;height:3
0px}.d4{width:40px;height:40px}
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjp
bIi4uLy4uLy4uLy4uL2Nzcy1sb2FkZXIhL3Nydi9odHRwL3MxL2ltZy11cmxzLzEuY3NzIl0sIm5hbWVzIjpbXSwibWFwcG
luZ3MiOiJBQUFBLElBQ0ksd0NBQXVCLENBQzFCLEFBQ0QsSUFDSSxXQUFZLEFBQ1osV0FBYSxDQUNoQixBQUNELElBQ0ksV
0FBWSxBQUNaLFdBQWEsQ0FDaEIsQUFDRCxJQUNJLFdBQVksQUFDWixXQUFhLENBQ2hCIiwiZmlsZSI6IjEuY3NzIiwic291
cmNlc0NvbnRlbnQiOlsiLmQxIHtcbiAgICBiYWNrZ3JvdW5kOiB1cmwoMS5wbmcpO1xufVxuLmQyIHtcbiAgICB3aWR0aDo
gMjBweDtcbiAgICBoZWlnaHQ6IDIwcHg7XG59XG4uZDMge1xuICAgIHdpZHRoOiAzMHB4O1xuICAgIGhlaWdodDogMzBweDtcbn1cbi5kNCB7XG4gICAgd2lkdGg6IDQwcHg7XG4gICAgaGVpZ2h0OiA0MHB4O1xufVxuIl19 */ Open SourceMap Inspector, put it into Output field, click Analyze, use Left, Right arrow buttons. But then this block of code turns it into: ".d1{background:url(" + escape(require("./1.png")) + ")}.d2{width:20px;height:20px}.d3{width:30px;height:30px}.d4{width:40px;height:40px}" And in the bundle we've got: exports.push([module.i, ".d1{background:url(" + escape(__webpack_require__("./1.png")) + ")}.d2{width:20px;height:20px}.d3{width:30px;height:30px}.d4{width:40px;height:40px}"...
And then: But when I comment out the P.S. Most likely, it's not only about image urls. Here's another thing that changes css code without updating source map. P.P.S. I can reproduce it even with I'm not sure how hard that is to fix. Do you have any ideas? Is this possible? |
@x-yuri Thanks! |
Don't have ideas how we can fix it on |
Let's close in favor #622, I have some ideas |
package.json
:webpack.config.js
:template.ejs
:1.js
:1.css
:Then open
http://example.com/dist
in Chrome. ThenDeveloper Tools
>Elements tab
. Then click on seconddiv
, and then on the link for.d2 { width: 20px; }
rule. And you'll find yourself on line 5. But if you removeminimize
param, you'll be at line 4, which is as it should be.P.S. node-7.1.0, Arch Linux
The text was updated successfully, but these errors were encountered: