Skip to content

Commit

Permalink
feat: allow top-level await in plugins or scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Pcrab committed Jun 14, 2023
1 parent c9ad8c6 commit 87fb1bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hexo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class Hexo extends EventEmitter {
req.extensions = Module._extensions;
req.cache = Module._cache;

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

const fn = runInThisContext(script, path);

Expand Down

0 comments on commit 87fb1bd

Please sign in to comment.