Last active
February 20, 2022 10:31
-
-
Save WebReflection/ef9c845ef222a53018c8ef06f4124809 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// keeping the same pattern | |
export default await new Promise(async $export => { | |
// export the module | |
$export({my: 'module'}); | |
}); | |
// dropping the Promise all together | |
export default await (async () => { | |
// await async dependencies | |
// export the module | |
return {my: 'module'}; | |
})(); | |
// both static and dynamic importers will work | |
import module from './module.js'; | |
// or | |
import('./module.js').then(m => { | |
const module = m.default; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment