fix(docs): use dynamic import for globby ESM module (#6636)
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { globby } = require('globby');
|
|
||||||
|
|
||||||
module.exports = function markdownExportPlugin(context, options) {
|
module.exports = function markdownExportPlugin(context, options) {
|
||||||
const pluginOptions = {
|
const pluginOptions = {
|
||||||
@@ -18,6 +17,8 @@ module.exports = function markdownExportPlugin(context, options) {
|
|||||||
|
|
||||||
console.log('[markdown-export] Starting markdown export...');
|
console.log('[markdown-export] Starting markdown export...');
|
||||||
|
|
||||||
|
const globby = (await import('globby')).default;
|
||||||
|
|
||||||
const docsDir = path.join(context.siteDir, 'docs');
|
const docsDir = path.join(context.siteDir, 'docs');
|
||||||
const outputDir = path.join(outDir, 'docs');
|
const outputDir = path.join(outDir, 'docs');
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { globby } = require('globby');
|
|
||||||
const matter = require('gray-matter');
|
const matter = require('gray-matter');
|
||||||
|
|
||||||
const DOCS_DIR = path.join(__dirname, '..', 'docs');
|
const DOCS_DIR = path.join(__dirname, '..', 'docs');
|
||||||
@@ -42,6 +41,8 @@ function getHeadings(content) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
const globby = (await import('globby')).default;
|
||||||
|
|
||||||
const sections = [
|
const sections = [
|
||||||
{ name: 'Getting Started', pattern: 'getting-started/*.{md,mdx}' },
|
{ name: 'Getting Started', pattern: 'getting-started/*.{md,mdx}' },
|
||||||
{ name: 'Guides', pattern: 'guides/**/*.{md,mdx}' },
|
{ name: 'Guides', pattern: 'guides/**/*.{md,mdx}' },
|
||||||
|
|||||||
Reference in New Issue
Block a user