Skip to content

Commit

Permalink
Await parse from es-module-lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Nov 12, 2023
1 parent 57db28e commit 80211d8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ export default async function loader(this: LoaderContext<any>, source: string) {
const callback = this.async();

try {
// Do NOT remove await here. The types are wrong! It has to be awaited,
// otherwise it will return a Promise<Promise<...>> when wasm isn't loaded.
// eslint-disable-next-line @typescript-eslint/naming-convention
const [_, exports = []] = parse(source);
const [_, exports = []] = await parse(source);

const namedExportsOrder = exports.some(
(e) => source.substring(e.s, e.e) === '__namedExportsOrder'
Expand Down

0 comments on commit 80211d8

Please sign in to comment.