Home Ask Login Register

Developers Planet

Your answer is one click away!

Rahul Dagli February 2016

webpack-dev-server - Browser not refreshing

I'm running webpack --watch and webpack-dev-server on 2 separate terminal on my Mac OSX. Everytime when I update the file, it recompiles in the terminal however, the browser doesn't reloads and I have to manually reload each time. I've installed all the required loaders.


var WebpackDevServer = require("webpack-dev-server");
var webpack = require('webpack');
var path = require('path');

var BUILD_DIR = path.resolve(__dirname, 'build');
var APP_DIR = path.resolve(__dirname, 'src');

module.exports = {
  entry: [
    APP_DIR + '/import.js',
  output: {
    path: BUILD_DIR,
    filename: 'bundle.js'
  module: {
    loaders: [{
      test: /\.jsx?$/,
      loaders: ['react-hot', 'babel?presets[]=es2015,presets[]=stage-0,presets[]=react,plugins[]=transform-runtime'],
      exclude: /node_modules/
    }, {
      test: /\.css$/,
      loader: "style-loader!css-loader"
    }, {
      test: /\.scss$/,
      loaders: ["style", "css", "sass"]
    }, {
      test: /\.(png|woff|woff2|eot|ttf|svg|jpg|gif)$/,
      loader: 'url-loader?limit=100000'
  plugins: [
    new webpack.OldWatchingPlugin(),
    new webpack.ProvidePlugin({
      $: "jquery",
      jQuery: "jquery"
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()


WitVault February 2016

Try by setting this entry point

  entry: [
    APP_DIR + '/import.js',

Post Status

Asked in February 2016
Viewed 3,085 times
Voted 9
Answered 1 times


Leave an answer

Quote of the day: live life