fix: load strapi before watch

This commit is contained in:
Alexandre Bodin 2024-10-21 15:19:21 -07:00
parent 20afc21f5d
commit 73ff3d9f3b

View File

@ -179,6 +179,8 @@ const develop = async ({
*/
let bundleWatcher: WebpackWatcher | ViteWatcher | undefined;
const strapiInstance = await strapi.load();
if (watchAdmin) {
timer.start('createBuildContext');
const contextSpinner = logger.spinner(`Building build context`).start();
@ -213,8 +215,6 @@ const develop = async ({
adminSpinner.succeed();
}
const strapiInstance = await strapi.load();
const loadStrapiDuration = timer.end('loadStrapi');
loadStrapiSpinner.text = `Loading Strapi (${prettyTime(loadStrapiDuration)})`;
loadStrapiSpinner.succeed();