@farmfe/runtime
Advanced tools
Comparing version 0.10.0 to 0.11.0
# @farmfe/runtime | ||
## 0.11.0 | ||
### Minor Changes | ||
- ef1b39bc: Top level await supported | ||
## 0.10.0 | ||
@@ -4,0 +10,0 @@ |
{ | ||
"name": "@farmfe/runtime", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"description": "Runtime of Farm", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -136,3 +136,3 @@ import { Module } from './module'; | ||
// initialize the new module | ||
initializer( | ||
const result = initializer( | ||
module, | ||
@@ -143,6 +143,16 @@ module.exports, | ||
); | ||
// call the module initialized hook | ||
this.pluginContainer.hookSerial('moduleInitialized', module); | ||
// return the exports of the module | ||
return module.exports; | ||
// it's a async module, return the promise | ||
if (result && result.then) { | ||
return result.then(() => { | ||
// call the module initialized hook | ||
this.pluginContainer.hookSerial('moduleInitialized', module); | ||
// return the exports of the module | ||
return module.exports; | ||
}); | ||
} else { | ||
// call the module initialized hook | ||
this.pluginContainer.hookSerial('moduleInitialized', module); | ||
// return the exports of the module | ||
return module.exports; | ||
} | ||
} | ||
@@ -149,0 +159,0 @@ |
25133
600