Skip to content

sass-loader and source maps output invalid sources in maps #576

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

Closed
alexander-akait opened this issue Jul 12, 2017 · 1 comment
Closed

sass-loader and source maps output invalid sources in maps #576

alexander-akait opened this issue Jul 12, 2017 · 1 comment

Comments

@alexander-akait
Copy link
Member

Do you want to request a feature or report a bug?

maybe bug

What is the current behavior?

Invalid sources in map then your use sass-loader and css-loader. More information inside issue below

If the current behavior is a bug, please provide the steps to reproduce.

Repo: webpack-contrib/sass-loader#484 (comment)

What is the expected behavior?

sources in map should be valid location.

If this is a feature request, what is motivation or use case for changing the behavior?

not required

Please mention other relevant information such as your webpack version, Node.js version and Operating System.

not required

Why it is happens: we use from - "/css-loader!" + options.from and when postcss build source map he use this as the dirname of the path to the SourceMap to be applied (https://github.com/postcss/postcss/blob/master/lib/map-generator.es6#L107). It is output invalid sources location (all sources interpreted as relative to from, but source can be not relative to from).

Workaround (before https://github.com/webpack-contrib/css-loader/blob/master/lib/processCss.js#L196):

inputMap.sources = inputMap.sources.map((source) => path.resolve(source));

But I'm not sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants