feat: Don't recompile typescript project if already compiled

pull/77/head
Tim Raasveld 2022-11-24 13:09:33 +01:00
parent 7206577eed
commit adae7af409
1 changed files with 2 additions and 1 deletions

View File

@ -21,8 +21,9 @@ const getStrapiApp = async () => {
const appDir = process.cwd(); const appDir = process.cwd();
const isTSProject = await tsUtils.isUsingTypeScript(appDir); const isTSProject = await tsUtils.isUsingTypeScript(appDir);
const outDir = await tsUtils.resolveOutDir(appDir); const outDir = await tsUtils.resolveOutDir(appDir);
const alreadyCompiled = await fs.existsSync(outDir);
if (isTSProject) { if (isTSProject && !alreadyCompiled) {
await tsUtils.compile(appDir, { await tsUtils.compile(appDir, {
watch: false, watch: false,
configOptions: { options: { incremental: true } }, configOptions: { options: { incremental: true } },