Skip to content
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

source-map resource urls coming out strange #529

Closed
DBosley opened this issue May 9, 2017 · 4 comments
Closed

source-map resource urls coming out strange #529

DBosley opened this issue May 9, 2017 · 4 comments

Comments

@DBosley
Copy link

DBosley commented May 9, 2017

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

@DBosley
Copy link
Author

DBosley commented May 9, 2017

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

@michael-ciniawsky
Copy link
Member

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

@DBosley
Copy link
Author

DBosley commented May 10, 2017

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.

@michael-ciniawsky
Copy link
Member

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

@michael-ciniawsky michael-ciniawsky modified the milestone: 0.28.3 May 22, 2017
@michael-ciniawsky michael-ciniawsky removed this from Bug in Dashboard May 22, 2017
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

2 participants