hot-callback-loader
Webpack loader that wraps a module in a callback that executes whenever the module hot updates
Installation
npm install hot-callback-loader --save-dev
Usage
// import using es6 syntax;// OR use commonjs syntaxconst hotMyModule = ; let MyModule;; // the above callback is executed synchronously, so we can use MyModule nowMyModule;
Getting the correct export
Often the object you want to load is exported as a default export of your module. To avoid having to manually type 'newMyModule.default' every time in the hot callback, you can set the loader to always pass a specific export.
// import using es6 syntax; ;