mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 21:16:59 +02:00
refactor(v2): shift plugin cache generation into its own dir
This commit is contained in:
parent
92c7e1f44b
commit
95ca07a646
3 changed files with 9 additions and 5 deletions
|
@ -99,10 +99,12 @@ module.exports = async function load(siteDir) {
|
|||
contents,
|
||||
};
|
||||
contentsStore[options.contentKey] = pluginContents;
|
||||
const pluginCacheDir = path.join(generatedFilesDir, name);
|
||||
fs.ensureDirSync(pluginCacheDir);
|
||||
await generate(
|
||||
generatedFilesDir,
|
||||
options.cachePath,
|
||||
`export default ${JSON.stringify(contents, null, 2)};`,
|
||||
pluginCacheDir,
|
||||
options.cacheFileName,
|
||||
JSON.stringify(contents, null, 2),
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
@ -141,5 +143,7 @@ module.exports = async function load(siteDir) {
|
|||
const routesConfig = await genRoutesConfig(props);
|
||||
await generate(generatedFilesDir, 'routes.js', routesConfig);
|
||||
|
||||
await generate(generatedFilesDir, 'routes.js', routesConfig);
|
||||
|
||||
return props;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue