Skip to content

Commit 87fb1bd

Browse files
committed
feat: allow top-level await in plugins or scripts
1 parent c9ad8c6 commit 87fb1bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/hexo/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ class Hexo extends EventEmitter {
387387
req.extensions = Module._extensions;
388388
req.cache = Module._cache;
389389

390-
script = `(function(exports, require, module, __filename, __dirname, hexo){${script}\n});`;
390+
script = `(async function(exports, require, module, __filename, __dirname, hexo){${script}\n});`;
391391

392392
const fn = runInThisContext(script, path);
393393

0 commit comments

Comments
 (0)