Skip to content

Commit 2de9d61

Browse files
committed
Export plugin options as default object
Export the llmsPluginOptions object directly (module.exports = llmsPluginOptions) and remove the individual property exports. This avoids adding a self-referential property that would create a circular structure and crash Docusaurus' genSiteConfig during JSON.stringify; customLLMFiles and ignoreFiles remain accessible as properties on the exported object.
1 parent a345109 commit 2de9d61

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/plugins/llms-html-injector/options.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ const llmsPluginOptions = {
236236
customLLMFiles,
237237
}
238238

239+
// Export the options object as the module default. `customLLMFiles` and
240+
// `ignoreFiles` are already reachable as properties on the exported object;
241+
// do NOT add a self-referential `llmsPluginOptions` property here — Docusaurus
242+
// runs `JSON.stringify` over the entire site config during `genSiteConfig`
243+
// (codegen.js), and a cycle would crash the build with
244+
// `TypeError: Converting circular structure to JSON`.
239245
module.exports = llmsPluginOptions
240-
module.exports.llmsPluginOptions = llmsPluginOptions
241-
module.exports.customLLMFiles = customLLMFiles
242-
module.exports.ignoreFiles = ignoreFiles

0 commit comments

Comments
 (0)