-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Fix file path in source maps #250
Conversation
Thx! 👍 I probably need to change this again because a loader should not access webpack options |
Shipped as |
Just wondering if it would be possible to retain the option of using output.path if present? I'm currently seeing a webpack build fail when loading font files... |
Do you have a sample configuration file with which the error could be reproduced? |
Hi there, unfortunately I can't provide the exact configuration although it is essentially based on https://github.com/davezuko/react-redux-starter-kit. With webpack.config here: I'd assume with this recent change that that project would have similar problems should custom fonts be loaded also. |
yes, it should be breaking change. I am facing the same error. |
same here |
After some more investigation. This change indeed breaks the resolve-url-loader. As you can see in https://github.com/bholloway/resolve-url-loader/blob/master/index.js#L63 the loader assumes that the sass-loader outputs source maps relative to the output directory. This was changed with this pull request. So this pull request might be considered as a breaking change. For now this change breaks a lot of installations. Basically everyone who uses resolve-url-loader is effected. So we either need a quick fix in resolve-url-loader or need to revert this change for now and put it in a new version 4.0. // cc: @bholloway, @jhnns |
Sorry I am not across this, I'm afk for at least a week. Just bad timing.
The source map base path isn't well standardised across loaders. I use
[adjust-sourcemap-loader] bholloway/adjust-sourcemap-loader) myself.
Is this change a done thing?
I would leave this for a major release if it changes default behaviour of
any kind. The output-relative had to be working for someone up until now
and they will be annoyed.
Or put it under an optional flag and call it a minor release.
|
Ok, I'll flag this version as broken, publish a new major release and then we can sort it out. No stress! 👍 @bholloway would you be open to make a PR to the sass-loader so that we have tests to check against the resolve-url-loader? Seems like more people are using it, so it would be nice to ensure compatibility. It was not obvious for me that this could be breaking change at all. If you do the PR, please mention me so I can merge it asap. |
Shipped as |
I created a pull request to resolve-url-loader to work again with the latest version. bholloway/resolve-url-loader#23 |
@jhnns given that you can't unpublish It would make it easier to specify to my users |
Ah yes. Sorry I thought I read that somewhere but I didn't see it in the tags. I should have checked with All good. |
There are currently two problems regarding source maps file path with this loader:
self.options.output.path
to be set. If you don't set this property the relative urls in line 281 is calculated wrong. By using the context this problem does not exist anymore.sourceRoot
property to express the relative path.In combination with the suggested fix for the css-loader (webpack-contrib/css-loader#280) this produces nice paths for source maps, that reflect the actual file structure within the project.