-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
fix(core): fix Docusaurus outDir for sites using baseUrl #11434
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: +278 B (0%) Total Size: 11.8 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
Size Change: +268 B (0%) Total Size: 12.2 MB ℹ️ View Unchanged
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Fix #11433
Docusaurus v3 should maintain a retro-compatible behavior regarding where it output files.
The new v3.9 i18n features implemented in #11316 broke that contract.
When a site has a
baseUrl: '/myBaseUrl/', then the files should be written/build/and/build/fr//build/myBaseUrl/and/build/myBaseUrl/fr/Note that in the future, we'll probably want to expose a new i18n
outDirconfig for each locale because it makes sense to 100% decouple the locale baseUrl from its outDir. It's possible to assemble things and rewrite URLs at the CDN level, so we only do a best effort to infer a decent outDir for each locale, but ultimately we should give total freedom to the user.Note that in the current state, there are cases where it's really hard to infer a decent outDir for a locale, such as this one:
In this case,
dedoes not start with/myBaseUrl/, but we can't output outside of the rootbuildfolder so this means we'll have as out dirs:buildbuild/frbuild/somethingElse/deThis creates an ambiguity where different baseUrls can be mapped to the same outDir, and may complicate deployments in such situations. Fortunately, this config was only introduced in v3.9, and most users will not do that, so I doubt it will be a problem in 99% of the cases, but it still further motivates the ability to provide an explicit
localeConfig.outDirvalue.Test Plan
local tests + CI snapshots