Skip to content

Commit 0aff7bc

Browse files
committed
Allow default exports from ESM in packages
1 parent 247afce commit 0aff7bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/package.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ class Package {
126126
* @return {Promise<undefined>}
127127
*/
128128
init() {
129-
const handler = require(this.script);
129+
const mod = require(this.script);
130+
const handler = typeof mod.default === 'function' ? mod.default : mod;
130131

131132
this.handler = handler(this.core, this);
132133

0 commit comments

Comments
 (0)