Skip to content

Weird source map paths when used together with css-loader #529

@woldner

Description

@woldner

Original bug report webpack-contrib/css-loader#652
(also reported here because I'm unsure where it belongs.)

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

What is the current behavior?
Wrong source map/resource paths using css-loader together with sass-loader as shown below:

Examples of source map paths using the plugin
The actual app.scss path is ./src/styles/app.scss

ex1

However the source map path for the file becomes ./src/styles/src/styles/app.scss and the absolute resource path:
C:/Users/m51n/source/repos/source-map-path/src/styles/src/styles/app.scss (does not exist)

ex2

If the current behavior is a bug, please provide the steps to reproduce.
I've created a sample project here-- using the source map example from the sass-loader docs and code from the extract-text-webpack-plugin docs here

With the sample project above I used devtool: "inline-source-map".

What is the expected behavior?
Expected source map path returned by the plugin in this case would be ./src/styles/app.scss and absolute resource path as it exist on disk:
C:/Users/m51n/source/repos/source-map-path/src/styles/app.scss

Related issues for reference
#484

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

webpack v3.10.0
node v9.2.0
os: windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions