webpack localhost / sockjs.js.map not found

0

I have the following error regarding socks.js.map, can anyone help me?

  

Failed to load resource: the server responded with a status of 404   (Not Found)

I installed the latest version of the webpack and webpack-dev-server and configured it like this:

const webpack = require('webpack');

module.exports = {
    entry : './index.js',
    output : {
        path: __dirname + '/public',
        filename : './bundle.js'
    },
    devServer: {
        port: 8080,
        contentBase: './public'
    },
    module: {
        loaders: [{
            test: /.js?$/,
            loader: 'babel-loader',
            exclude: /node-modules/,
            query: {
                presets : ['es2015']
            }
        }]
    }

}

My package.json has a script:

"dev": "webpack-dev-server --progress --colors --inline --hot"
    
asked by anonymous 15.11.2017 / 19:37

1 answer

0

If the latest version of the webpack means v2 or v3, the format of your module is wrong. Now we use module.rules instead of module.loaders . It's like this now:

  module: {
      rules: [{
          test: /.js?$/,
          exclude: /node-modules/,
          use: {
              loader: 'babel-loader',
              options: {
                  presets : ['es2015']
              }
          }
      }]
  }

(Ref link )

    
29.11.2017 / 18:36