Skip to content

Commit

Permalink
chore: wat
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjosephprice committed Dec 9, 2024
1 parent 5849d4a commit b857a4a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ const compile = (text: string, { components, copyButtons, ...opts }: CompileOpts
...opts,
});

return (
String(vfile).replace(
/await import\(_resolveDynamicMdxSpecifier\(('react'|"react")\)\)/,
'arguments[0].imports.React',
).replace('"use strict";', '"use strict";\nconst { user } = arguments[0].imports;'),
);
return String(vfile)
.replace(/await import\(_resolveDynamicMdxSpecifier\(('react'|"react")\)\)/, 'arguments[0].imports.React')
.replace('"use strict";', '"use strict";\nconst { user } = arguments[0].imports;');
} catch (error) {
throw error.line ? new MdxSyntaxError(error, text) : error;
}
Expand Down

0 comments on commit b857a4a

Please sign in to comment.