mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-01 16:00:29 +02:00
feat(core): warn users about hand-modifying generated files (#6419)
* feat(core): warn users about hand-modifying generated files * Better folder name
This commit is contained in:
parent
d133910cb2
commit
65c2fc200a
1 changed files with 16 additions and 1 deletions
|
@ -304,13 +304,27 @@ export async function load(
|
|||
context.siteConfig.themeConfig = themeConfigTranslated;
|
||||
|
||||
handleDuplicateRoutes(pluginsRouteConfigs, siteConfig.onDuplicateRoutes);
|
||||
const genWarning = generate(
|
||||
generatedFilesDir,
|
||||
'DONT-EDIT-THIS-FOLDER',
|
||||
`This folder stores temp files that Docusaurus' client bundler accesses.
|
||||
DO NOT hand-modify files in this folder because they will be overwritten in the
|
||||
next build. You can clear all build artifacts (including this folder) with the
|
||||
\`docusaurus clear\` command.
|
||||
`,
|
||||
);
|
||||
|
||||
// Site config must be generated after plugins
|
||||
// We want the generated config to have been normalized by the plugins!
|
||||
const genSiteConfig = generate(
|
||||
generatedFilesDir,
|
||||
DEFAULT_CONFIG_FILE_NAME,
|
||||
`export default ${JSON.stringify(siteConfig, null, 2)};`,
|
||||
`/*
|
||||
AUTOGENERATED - DON'T EDIT
|
||||
Your edits in this file will be overwritten in the next build!
|
||||
Modify the docusaurus.config.js file at your site's root instead.
|
||||
*/
|
||||
export default ${JSON.stringify(siteConfig, null, 2)};`,
|
||||
);
|
||||
|
||||
plugins.push(createBootstrapPlugin({siteConfig}));
|
||||
|
@ -402,6 +416,7 @@ ${Object.keys(registry)
|
|||
);
|
||||
|
||||
await Promise.all([
|
||||
genWarning,
|
||||
genClientModules,
|
||||
genSiteConfig,
|
||||
genRegistry,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue