Repository navigation
fix(utils): reload the modules imported by the config on the Bun runtime - #13026
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a3c1250 to
333dfcb
Compare
Motivation
With
docusaurus starton the Bun runtime, editingdocusaurus.config.tsreloads the config, but not the modules it imports: they keep their old values until the dev server restarts. The same goes for sidebars and plugins loaded withloadFreshModule().jiti defaults to
tryNative: "Bun" in globalThis: on Bun, it loads modules with the nativeimport(), whose module cache lives as long as the process. OurmoduleCache: falseoption doesn't bypass it. WithtryNative: false, jiti uses its own loader on Bun too, like on Node.js.The bunosaurus fork found and fixed the same problem.
Test Plan
Vitest runs on Node.js, so I tested it manually on a new classic site whose
docusaurus.config.tsimportstaglinefrom asiteTagline.tsmodule. I randocusaurus start, changedsiteTagline.ts, then edited the config to trigger a reload, and checked.docusaurus/docusaurus.config.mjs:--bun)Test links
Deploy preview: https://deploy-preview-13026--docusaurus-2.netlify.app/
Related issues/PRs
Running on Bun with
--bunalso needs #13024🤖 Generated with Claude Code