8

It used to work. Now when I add a breakpoint:

saveSnippet: (title, imageUrl, role) => {

        debugger;
        ...

The result in chrome (53) is:

breakpoint

I tried playing with it and changing the config to 'cheap-module-source-map' and 'eval-source-map' and 'source-map'. Only 'eval-source-map' and 'source-map' work now.

The webpack.config.js (Webpack 1.13.2):

  var path = require('path')
  var webpack = require('webpack')
  var CompressionPlugin = require("compression-webpack-plugin");

  module.exports = {
    debug: true,
    pathinfo:true,
    devtool: 'cheap-module-eval-source-map',
    entry: [
      'webpack-hot-middleware/client',
      './app/index'
    ],
    output: {
      path: path.join(__dirname, 'dist'),
      filename: 'bundle.js',
      publicPath: '/static/'
    },
    plugins: [
      new webpack.optimize.OccurrenceOrderPlugin(),
      new webpack.HotModuleReplacementPlugin(),
      new CompressionPlugin({
        asset: "[path].gz[query]",
        algorithm: "gzip",
        test: /\.js$|\.css$|\.html$/,
        threshold: 10240,
        minRatio: 0.8
      })

    ],
    module: {
      loaders: [{
        test: /\.js$/,
        loaders: ['babel'],
        exclude: /node_modules/,
        include: __dirname
      }]
    }
  }
d4nyll
  • 11,811
  • 6
  • 54
  • 68
Guy
  • 12,488
  • 16
  • 79
  • 119

2 Answers2

1

Try to add:

new webpack.EvalSourceMapDevToolPlugin()

to your plugins section in webpack config.

cryss
  • 4,130
  • 1
  • 29
  • 34
1

This answer is not exactly a fix—it's equivalent to overriding the devtool setting to a different (slower) mode.

The right fix was submitted in this pull request, and you can now update to Webpack 1.14.0 that includes it.

Community
  • 1
  • 1
Dan Abramov
  • 264,556
  • 84
  • 409
  • 511