diff --git a/packages/loader/index.cjs b/packages/loader/index.cjs index a5a1e9201..af2e7913a 100644 --- a/packages/loader/index.cjs +++ b/packages/loader/index.cjs @@ -7,6 +7,10 @@ 'use strict' +// Note: we can’t export immediately, as TS generates broken types. +// See: mdx-js/mdx#2386. +module.exports = loader + /** * Webpack loader * @@ -19,7 +23,7 @@ * @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) => {