fix(docs): use dynamic import for globby ESM module (#6636)

This commit is contained in:
Rizel Scarlett
2026-01-22 11:37:58 -05:00
committed by GitHub
parent 7dc28dd050
commit 7a8f626102
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -1,6 +1,5 @@
const fs = require('fs');
const path = require('path');
const { globby } = require('globby');
module.exports = function markdownExportPlugin(context, options) {
const pluginOptions = {
@@ -18,6 +17,8 @@ module.exports = function markdownExportPlugin(context, options) {
console.log('[markdown-export] Starting markdown export...');
const globby = (await import('globby')).default;
const docsDir = path.join(context.siteDir, 'docs');
const outputDir = path.join(outDir, 'docs');
+2 -1
View File
@@ -1,6 +1,5 @@
const fs = require('fs');
const path = require('path');
const { globby } = require('globby');
const matter = require('gray-matter');
const DOCS_DIR = path.join(__dirname, '..', 'docs');
@@ -42,6 +41,8 @@ function getHeadings(content) {
}
async function main() {
const globby = (await import('globby')).default;
const sections = [
{ name: 'Getting Started', pattern: 'getting-started/*.{md,mdx}' },
{ name: 'Guides', pattern: 'guides/**/*.{md,mdx}' },