-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
css sourceMappingURL is broken #65
Comments
To be honest, I don't have much experience with sourcemaps. @ef4 Do you have any thoughts on this? |
Would you be willing to contribute a failing test case for this? Once I have a failing case, I can work on fixing it. |
@rickharrison @ef4 I can confirm that this is still happening. CSS SourceMap files have a double extension of .css.map. The issue happens when getting the file extension at https://github.com/rickharrison/broccoli-asset-rev/blob/master/lib/fingerprint.js#L103. |
Hi @rickharrison, Thank you for maintaining the project. In my limited use, it seems to work fairly easily out of the box. I ran into this sourcemap issue, so I wanted to create the test as you recommended. I could probable fix it, too, if you want to provide some feedback. I think that @sathappan has a good point, and that is one option for fixing the issue, but replacing node's path module may not be very easy. Another option would be to try and prevent links from being replaced twice. From the test, you will see that the map url gets replace, but then it triggers a match on the css replace, which creates an obviously incorrect path. You can find my tests here: master...glhewett:65-css-sourcemaps Thanks, and let me know how I can help. |
I also wanted to mention that a JS sourcemap test would be beneficial as well. I would assume that it might be suffering the same fate as the CSS sourcemap. |
Thanks for creating a failing test case. Can you open up a PR with the test case so others can see it? For full transparency, I am not going to have time to work on this in the near future. Busy with work, holidays, etc. |
@rickharrison, thanks for setting expectations. Any feedback you have would be helpful, I am sure I can fix it eventually. Below is the output of the failing tests. I have create a pr: #113
|
Hi there. Bumping this up as I encountered the issue today. Any fix or workaround since 2016? Thanks ❤️ |
To give people some context and expectations: broccoli-asset-rev mostly works OK and so people keep using it. But it has some pretty fundamental problems and AFAIK nobody is actively working on rewriting it to something better. (Well, that's not exactly true. I'm working on Embroider which eliminates the entire need for broccoli-asset-rev, but that is probably not the answer you're looking for.) The fundamental problems are:
These are both solvable, but they probably involve a rewrite that thinks about the problem differently than broccoli-asset-rev does. This particular bug is caused by the second problem. If you first replace If I was to suggest a workaround for this particular bug, it would be to see if you can get your sourcemap named something completely different, so that the name of the source file doesn't appear inside the name of the source map file. |
@ef4 Thanks for your answer! Regarding point 1 I suppose some sort of topological sorting could help but like you said it would require to rethink the whole behavior. Regarding point 2 I will try to see if I can change the map names I'm using rollup and broccoli-sass-source-maps so I'll have to dig a bit to see if that's even possible. I'll post an update if I do find a solution. |
I'm trying to use this plugin with CSS source maps, but I can't get it to work in any fashion because this plugin doesn't understand the double extension. With this config:
I get this css file:
/*# sourceMappingURL=main-aafff1edf19e012de9347224d8cd4856.css-e997028ad01268b4cda33c1c4ce89b36.map */
but the source-map is renamed to
main.css-e997028ad01268b4cda33c1c4ce89b36.map
Other combinations have similar results - even ignoring
css.map
doesn't help.The text was updated successfully, but these errors were encountered: