themaster
themaster

Reputation: 375

Webpack hot loader will occasionally detect changes made

I've been fiddling with Webpack for the past few days. I seem to have got it to work the way i want it to. However on Windows 7 when I make a change to a file the script doesn't start another recompile. Seems to work fine on a mac OSX when I tested.

webpack.config.js

var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    entry: [
        'webpack-dev-server/client?http://localhost:8080',
        'webpack/hot/only-dev-server',
        './src/index.js',
        './src/scss/main.scss'
    ],
    output: {
        path: __dirname,
        publicPath: '/',
        filename: '/public/bundle.js'
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                loaders: ['react-hot', 'jsx', 'babel'],
                exclude: /node_modules/,
            },
            {
                test: /\.scss$/,
                loader: ExtractTextPlugin.extract('css!sass'),
            }
        ]
    },
    resolve: {
        extensions: ['', '.js', '.jsx']
    },
    devServer: {
        historyApiFallback: true,
        contentBase: './',
        hot: true
    },
    devtool: 'source-map',
    plugins: [
        new webpack.optimize.OccurenceOrderPlugin(),
        new webpack.HotModuleReplacementPlugin(),
        new ExtractTextPlugin('public/style.css', {
            allChunks: true
        }),
        new webpack.NoErrorsPlugin()

    ]
};

in the browser console all I get the following

[HMR] Waiting for update signal from WDS...
[WDS] Hot Module Replacement enabled.

Any ideas how I could fix this problem? would be very helpful thanks.

Upvotes: 0

Views: 121

Answers (1)

themaster
themaster

Reputation: 375

In Webstorm you will need to turn off: Use "safe write" (save changes to temporary file first)

You can do this by: Settings > Appearance & Behavior > System Settings > Use "safe write" (save changes to temporary file first)

Upvotes: 1

Related Questions