custom module: fix autoreload on nested submodules

This commit is contained in:
jean-emmanuel 2022-11-29 16:58:48 +01:00
parent 07beecc9db
commit 454884eb81
2 changed files with 4 additions and 1 deletions

View file

@ -2,6 +2,9 @@
## 1.21.0
- bug fixes
- custom module: fix autoreload on nested submodules
- launcher
- print a qrcode when the server starts to help connecting mobile devices

View file

@ -233,7 +233,7 @@ class CustomModule {
filename = path.resolve(path.dirname(this.filename), filename)
}
this.submodules[filename] = loadedModules[filename] || new CustomModule(filename, this.context, this, this.parent || this)
this.submodules[filename] = loadedModules[filename] || new CustomModule(filename, this.context, this, this.mainModule || this)
return this.submodules[filename].module.exports