work-around for lost paths to source files in source map #1053
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains a:
Motivation / Use-Case
When css-loader calls postcss with an existing source map previously generated by postcss-loader, the resulting source map ends up with just the file name for sources without any paths. If there are then collisions of this file name with other same-named files in other directories, only one of these source maps ends up being retained.
This is particularly noticeable for the react-toolbox project which has about a dozen files all named theme.modules.css in different directories.
See https://github.com/alexhisen/mobx-forms-demo project for example config, etc. Note it's currently set up to use this fork, so it doesn't exhibit the problem any more.
Additional Info
This fix is a dirty hack workaround. There is probably a better way to fix this issue but I don't know enough about webpack, postcss, or this loader to know how to fix this better.