mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
wire VCS initialize()
This commit is contained in:
parent
7dc89e0b98
commit
bc9e135ab5
|
|
@ -101,6 +101,10 @@ export async function loadContext(
|
|||
}),
|
||||
});
|
||||
|
||||
// Not sure where is the best place to put this VCS initialization call?
|
||||
// The sooner is probably the better
|
||||
initialSiteConfig.future.experimental_vcs.initialize({siteDir});
|
||||
|
||||
const currentBundler = await getCurrentBundler({
|
||||
siteConfig: initialSiteConfig,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -160,10 +160,15 @@ function createCustomVcsConfig(): VcsConfig {
|
|||
|
||||
return {
|
||||
initialize: ({siteDir}) => {
|
||||
console.log('initializing custom site VCS config...');
|
||||
getRepoInfoForFile(siteDir).catch((e) => {
|
||||
console.error('Failed to read the Docusaurus Git repository info', e);
|
||||
});
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// Only pre-init for production builds
|
||||
getRepoInfoForFile(siteDir).catch((error) => {
|
||||
console.error(
|
||||
'Failed to initialize the custom Docusaurus site Git VCS',
|
||||
error,
|
||||
);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getFileCreationInfo: async (filePath: string) => {
|
||||
|
|
@ -171,6 +176,8 @@ function createCustomVcsConfig(): VcsConfig {
|
|||
},
|
||||
|
||||
getFileLastUpdateInfo: async (filePath: string) => {
|
||||
// TODO implement this too!
|
||||
|
||||
return getRepoInfoForFile(filePath);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue