mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
site vcs cleanup
This commit is contained in:
parent
acfb1733de
commit
86f792d5f3
|
|
@ -122,18 +122,12 @@ async function getGitRepoLastCommitInfoMap(
|
|||
});
|
||||
}
|
||||
|
||||
const isBuild = true; // TODO
|
||||
|
||||
function createCustomVcsConfig(): VcsConfig {
|
||||
if (process.env.DOCUSAURUS_WEBSITE_USE_OLD_VCS_STRATEGY === 'true') {
|
||||
console.log("Using the old Docusaurus website's VCS strategy");
|
||||
return DEFAULT_VCS_CONFIG;
|
||||
}
|
||||
|
||||
if (!isBuild) {
|
||||
return DEFAULT_VCS_CONFIG;
|
||||
}
|
||||
|
||||
let repoInfoPromise: Promise<CommitInfoMap> | null = null;
|
||||
|
||||
async function getRepoInfoForFile(
|
||||
|
|
@ -148,16 +142,6 @@ function createCustomVcsConfig(): VcsConfig {
|
|||
return repoInfo.get(filePath) ?? null;
|
||||
}
|
||||
|
||||
// Try to pre-read the Git repository info as soon as possible
|
||||
|
||||
// TODO pre-init here doesn't work because of double config loading
|
||||
/*
|
||||
getRepoInfoForFile('.').catch((e) => {
|
||||
console.error('Failed to read the Docusaurus Git repository info', e);
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
return {
|
||||
initialize: ({siteDir}) => {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue