feat(mdx-loader): upgrade to MDX v3 + (#9451)

This commit is contained in:
Sébastien Lorber 2023-10-26 15:47:11 +02:00 committed by GitHub
parent 8d19054d91
commit 7e456ece3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 37351 additions and 30469 deletions

View file

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/
import visit from 'unist-util-visit';
import npmToYarn from 'npm-to-yarn';
import type {Code, Literal} from 'mdast';
// @ts-expect-error: TODO see https://github.com/microsoft/TypeScript/issues/49721
@ -173,7 +172,9 @@ function createImportNode() {
const plugin: Plugin<[PluginOptions?]> = (options = {}): Transformer => {
// @ts-expect-error: todo temporary
const {sync = false, converters = ['yarn', 'pnpm']} = options;
return (root) => {
return async (root) => {
const {visit} = await import('unist-util-visit');
let transformed = false;
let alreadyImported = false;