package
One of the dumb yet useful package. This will append hot.module.accept() to your entry file of your project automatically
npm install hot-module-acceptGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
This is a simple loader which will append the module.accept() to the bottom of the entry script of your project. So you don't have to worry about having a module statement in the production build.
Works best with webpack-dev-server
Install the package
npm i hot-module-accept
Modify your webpack config file
var config = {
// Also add 'hot-module-accept' to your existing JS/JSX loaders.
//For Example:
loaders: [
{
test: /\.(js|jsx)$/,
loaders: [
'babel' //Not necessary for this loader
'hot-module-accept'
]
}
]
} The loader will automatically process the entry in your webpack config.
Optionally, you can add an entryPoint field to your webpack config also. The loader will treat it as the entry point. It should be a valid string