angularjs - angular + webpack: "Hot Module Replacement is disabled" error after build -


i'm having problem pretty straight forward webpack configuration:

var webpack = require('webpack');     path = require('path');  var paths = {     app: __dirname + "/app" };  var config = {     context: paths.app, entry: {     app: ['webpack/hot/dev-server',  './core/bootstrap.js'] } ,  // entry: './core/bootstrap.js',  output: {     path: paths.app,     filename: 'bundle.js' }, module: {     loaders: [         {test: /\.js$/, loader: 'ng-annotate!babel', exclude: /node_modules/},         {test: /\.less$/, loader: "style!css!less", exclude: /node_modules|bower_components/},           {test: /\.json$/, loader: "json", exclude: /node_modules|bower_components/},         {test: /\.html$/, exclude: /node_modules/, loader: "raw"},         {test: /\.(ttf|eot|svg|otf)$/, loader: "file"},         {test: /\.woff(2)?$/, loader: "url?limit=10000&minetype=application/font-woff"}      ] },  plugins: [     new webpack.defineplugin({         on_test: process.env.node_env === 'test'     }) ],  devtool: "#inline-source-map"  }  if (process.env.node_env === 'production'){     config.output.path = __dirname + '/dist';     config.plugins.push(new webpack.optimize.uglifyjsplugin());     config.devtool = 'source-map'; }  module.exports = config; 

i'm trying build minified version of code , when i'm running node_env=production node node_modules/.bin/webpack && cp app/index.html dist/index.html there no bundle.min.js in dist folder , when i'm running http-server dist i'm getting uncaught error: [hmr] hot module replacement disabled.

from going through web see common problem did find way fix this: i'm using --hot flag suppose add hot-swap plugin.


Comments