Skip to content
This repository was archived by the owner on Aug 28, 2026. It is now read-only.
This repository was archived by the owner on Aug 28, 2026. It is now read-only.

source-map resource urls coming out strange #529

Closed

Description

@DBosley

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

What is the current behavior?
Using postcss-loader (only using autoprefixer plugin, no extra configurations) combined with sass-loader, css-loader, and style-loader causes the resource URL for sourcemaps to be strange:

example: http://imgur.com/a/R73hV
scss loader config

{
          test: /\.scss$/,
          use: [{
              loader: 'style-loader',
              options: {
                sourceMap: true,
              }
            },
            {
              loader: 'css-loader',
              options: {
                sourceMap: true,
              }
            },
            {
              loader: 'postcss-loader',
              options: {
                sourceMap: true,
                //parser: require('postcss-scss'),
              }
            },
            {
              loader: 'sass-loader',
              options: {
                includePaths: [
                  './src/styles/bootstrap',
                  './src/styles/partials'
                ],
                sourceMap: true,
              }
            },
          ],
          include: [helpers.root('src', 'styles')]
        }

What is the expected behavior?
relative urls for sourcemaps, or at least only one absolute url

Please mention other relevant information such as your webpack version, Node.js version and Operating System.
webpack: 2.5.1
node: 6.10.3
windows 10

Activity

  1. DBosley commented on May 9, 2017

    @DBosley
    Author

    This issue seems to affect multiple loaders. Posted the same issue on all affected loaders:
    #529
    webpack/sass-loader#451
    webpack/style-loader#231
    webpack/postcss-loader#224

  2. michael-ciniawsky commented on May 9, 2017

    @michael-ciniawsky
    Contributor

    It's likely to be in postcss-loader :)

  3. added this to the milestone on May 9, 2017
  4. DBosley commented on May 10, 2017

    @DBosley
    Author

    I tried quite a few different configs today trying to figure this out. Some for scss files, some for css. For css files, I wasn't ever able to get relative paths in chrome, but by ordering my css config like this:

    {
      test: /\.css$/,
      use: [{
          loader: 'style-loader',
        },
        {
          loader: 'css-loader',
          options: {
            sourceMap: true
          }
        },
        {
          loader: 'postcss-loader',
        }
      ],
      include: [helpers.root('src', 'styles')]
    },
    

    I was able to get rid of the extra absolute paths.

  5. michael-ciniawsky commented on May 22, 2017

    @michael-ciniawsky
    Contributor

    Should be fixed by #532, released in v0.28.2

  6. modified the milestone: on May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions