Skip to content

Instructions regarding source maps are incorrect #150

@WishCow

Description

@WishCow

The README says that you have to use the extract-text-webpack-plugin to get source maps working, however that is not entirely correct. You can get it working that way, but that will make it impossible to get livereload (or hmr) working.

After following the conversion in a closed ticket webpack-contrib/extract-text-webpack-plugin/issues/30, @sokra said that the extract-text plugin is not supposed to be used in development. If you want to get sourcemaps working, you just have to add ?sourceMap to both the css loader, and the scss loader, like this:

{
  test: /\.scss$/,
  loaders: [ 'style', 'css?sourceMap', 'sass?sourceMap' ]
}

This will allow both live reloading, and sourcemaps to work, without involving the extract-text plugin at all. It does have a bit of a weird file name in Chrome, but clicking on it takes you to the correct file and line number. From my rudimentary testing, the value of the "devtool" flag doesn't seem to effect the generated sourcemaps at all, it works for me with both "eval", "source-map".

chrome sourcemaps

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