-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Description
Hi,
Before my code to handle hot reloading on my server side was something like
dep.js
var modDep = {};
module.exports = modDep ;
main.js
var dep= require('dep');
// do some stuff
//
// check if HMR is enabled
// --------------------
if(module.hot) {
module.hot.accept(['dep'], () => {
dep= require('dep');
});
}
And it was really fine.
Then I decided refactoring server side code to ES6 syntax with import/export way of doing. Note that I use Babel transpiler.
dep.js
var modDep = {};
// before
// module.exports = modDep ;
export default modDep;
And same main.js but really it was not working well...
Also if I update my main.js code to
main.js
import dep from 'dep';
// do some stuff
//
// check if HMR is enabled
// --------------------
if(module.hot) {
module.hot.accept(['dep'], () => {
dep= require('dep');
});
}
It says dep is readonly etc...
Do you think it will be possible later ?
Thanks in advance.
Julien