const init = (callback) => { // Remove static content generation target directory removeSync(contentDir); // Watch files for configuration reload for (const file of configReloadWatchers) { if (existsSync(file)) watch(file, {}, loadUserConfig); } i18nOptions.root = root; let i18nWatchDirs = [pageDir, layoutsDir]; let launchPreparation = [ initSitedata(), i18nInit(localesDir, i18nWatchDirs, i18nOptions), bundleBrowserify(browserifyDir, browserifyTargetDir, jsModuleOptions), bundleLess(lessDir, lessTargetDir, lessOptions) ]; Promise.all(launchPreparation).then(() => { if (callback) callback(null, true); }); }