During the hot update in webpack development server in console I see these messages:
[HMR] Updated modules:
[HMR] - 1009
[HMR] - 1007
I would rather see the path names in there and I remember there was a plugin for that, but could not find it in Google.
The entry object is where webpack looks to start building the bundle. The context is an absolute string to the directory that contains the entry files.
The ModuleFederationPlugin allows a build to provide or consume modules with other independent builds at runtime. const { ModuleFederationPlugin } = require('webpack').
Enables Hot Module Replacement, otherwise known as HMR.
webpack.config.jsWe can also pass an array of file paths to the entry property which creates what is known as a "multi-main entry". This is useful when you would like to inject multiple dependent files together and graph their dependencies into one "chunk".
UPDATED ANSWER:
In webpack 4 it's just on by default when mode is set to development
module.exports = {
mode: 'development',
}
and can be controlled directly as well:
module.exports = {
//...
optimization: {
namedModules: true
}
};
ORIGINAL ANSWER: (for older webpack versions)
I have found it myself, it's part of webpack
itself it seems.
here is how you add it:
plugins: [
new webpack.NamedModulesPlugin(),
...
]
Now the module names in console and in the source will be like that:
[HMR] Updated modules:
[HMR] - ./../MyModule1.jsx
[HMR] - ./../MyModule2.jsx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With