What I have
I created a small Webpack HMR Hello World with the following config file:
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
app: path.join(__dirname, 'app/index.js'),
},
output: {
path: path.join(__dirname, 'build'),
filename: 'app.js',
},
module: {
rules: [
{
test: /\.jsx?$/,
use: [
'babel-loader',
],
exclude: /node_modules/
},
],
},
plugins: [
new webpack.NamedModulesPlugin(),
],
};
Then I run webpack-dev-server
from an npm script and serve the file under http://localhost:8080/app.js
. I include this file in my index.html
and everything (including HMR) works fine in the browser.
The problem
I installed NW.js (Node-Webkit) via npm and set this index.html
as an entry point for the main
property in package.json
. The application works properly but when I edit a file, HMR doesn't happen. Why it doesn't work in NW.js when it works in the browser?