-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
Make urls absolute in blob #96
Conversation
This avoid requirements to specify absolute path to output.publicPath
Soo? |
Give this man a cookie! |
Wooo, so does this PR give us full source maps with relative path assets, without the need for an absolute 👏 |
@oller sure. Tested by using in real project, works like a charm. |
Worked for me at first glance. Any reason why this isn't merged? |
Thanks for the patch. Works like charm. |
@sokra this is really helpful patch, as you can see. could you merge it? Or maybe I could somehow improve this patch? |
bump. Need this patch |
Come on, please merge :) |
Pleeeeaaase! 🎁 |
It's been 5 months... Is there any reason for this not to be merged @sokra ? |
yes. This is not a good solution. It should be solved on CSS AST. It's better to solve it before the style loader in the css loader |
@sokra I can't find any code in css-loader that is client side, which is where this logic would need to reside so it knows the browser location at run time. Can you point us in the right direction? |
@Strate great idea and great work! I just submitted a very similar pull request which is opt-in via a Anyone feel free to fork bendytree/style-loader and then use a git url in your package.json:
|
@sokra any guidance you could provide @Strate / @bendytree et al to solve this properly in the CSS AST as you suggested? |
As for me, use css ast on client side would be an overkill. This patch used in real world project since it's creation without any problem. With keeping in mind that it used only in dev environment, I could say that it has sufficient quality to merge. |
This is a huge issue on my project as well, can we get update why this hasn't been merged? |
Adding an additional "please". Or at least provide feedback how this could be made better. |
I'll work on this this afternoon. I have some ideas how to solve this correctly on AST level. But I'll have to test the performance impact. |
Attention please. I've found a solution for the problem without patching this loader.
This line modifies // webpack.config.js
module.exports = {
pluginns: [
new webpack.DefinePlugin({
'process.env.WEBPACK_PUBLIC_PATH': JSON.stringify(process.env.WEBPACK_PUBLIC_PATH)
})
]
}
// topmostEntryPoint.js
__webpack_public_path__ = window.location.protocol + "//" + window.location.host + "/" + process.env.WEBPACK_PUBLIC_PATH; and run build with command:
|
Ugly hack which solves an issue with not loading images with generated urls in css files. Related issues: webpack-contrib/style-loader#96
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebase + tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep rebase and test please
Also - There were compliance issues we needed to clear up before the CLA bot could be enabled, that was cleared up about 10 days ago. To get the CLA signed, you just need to close this PR & open it again. That will trigger the CLA workflow again which should allow you to sign it. Please note, before you close & open it again ensure the email in your local git config matches what you have configured in github. |
I looks like this PR might be superseded by #124? |
@d3viant0ne Yeah, sounds fine. |
@d3viant0ne have you read this comment: #96 (comment)? This is how I solve this issue current in my project. I think it is enougth to move this trick to README. |
It's workaround vs. fix where the workaround is only effective in some cases. This is an issue that needs to be resolved in code |
This should be closed in favor of #124 which has already been merged. |
Related #93