Skip to content

Commit

Permalink
Fix @mdx-js/loader types
Browse files Browse the repository at this point in the history
The code was fine, but was affected by a TypeScript bug.

microsoft/TypeScript#56229
  • Loading branch information
remcohaszing committed Oct 27, 2023
1 parent 038bb68 commit 9f997e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/loader/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
* @returns {undefined}
* Nothing.
*/
module.exports = function (code) {
function loader(code) {
const callback = this.async()
// Note that `import()` caches, so this should be fast enough.
import('./lib/index.js').then((module) => {
return module.loader.call(this, code, callback)
})
}

module.exports = loader

0 comments on commit 9f997e6

Please sign in to comment.