-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): support docusaurus.config.cjs as default file name #7371
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Size Change: 0 B Total Size: 796 kB ℹ️ View Unchanged
|
I discovered that issue trying to migrate @slorber @lex111 Can you please release a new beta with this change? 🙏 |
@IvanGoncharov This is more complex than that. See #7379 also, which kind of got blocked because of a cryptic error I don't know how to fix for now (and haven't looked deeply into). If you just want the changes from this PR, you can always use Also, we have our release schedule, so if we reviewed and merged it, you can always use the canary release instead of waiting for the next stable release. |
@@ -156,7 +156,7 @@ next build. You can clear all build artifacts (including this folder) with the | |||
|
|||
const genSiteConfig = generate( | |||
generatedFilesDir, | |||
DEFAULT_CONFIG_FILE_NAME, | |||
`${DEFAULT_CONFIG_FILE_NAME}.mjs`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related: #7379
53ec38a
to
76cfe26
Compare
LGTM 👍 |
Pre-flight checklist
Motivation
Related: #6520, #5379
I have heard of users who have
"type": "module"
in their package.json, which often prevents the docusaurus.config.js file from being read correctly. We should support .cjs extension out-of-the-box, which can also enable us to support .mjs, or even .ts in the future.In addition, I fixed a little bug with the error message where it's using the default config file name instead of the actual one.
Test Plan
Added a test case.
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs