UPDATED RESPONSE:
In webpack 4, it is just turned on by default when set to development
module.exports = {
mode: 'development',
}
and can also be controlled directly:
module.exports = {
optimization: {
namedModules: true
}
};
ORIGINAL RESPONSE: (for older versions of webpack)
I found it myself, this is part of myself, it webpackseems. this is how you add this:
plugins: [
new webpack.NamedModulesPlugin(),
...
]
Now the names of the modules in the console and in the source will be like this:
[HMR] Updated modules:
[HMR] - ./../MyModule1.jsx
[HMR] - ./../MyModule2.jsx
source
share