// Lazy: only resolved when compileStrapi is invoked (develop / build) let lazyTsUtils; const tsUtils = ()=>{ if (!lazyTsUtils) { // eslint-disable-next-line @typescript-eslint/no-var-requires lazyTsUtils = require('@strapi/typescript-utils'); } return lazyTsUtils; }; async function compile(options) { const { appDir = process.cwd(), ignoreDiagnostics = false } = options ?? {}; const isTSProject = await tsUtils().isUsingTypeScript(appDir); const outDir = await tsUtils().resolveOutDir(appDir); if (isTSProject) { try { await tsUtils().compile(appDir, { configOptions: { options: { incremental: true }, ignoreDiagnostics } }); } catch (err) { // we exit here to maintain the same behavior as before. process.exit(1); } } const distDir = isTSProject ? outDir : appDir; return { appDir, distDir }; } export { compile as default }; //# sourceMappingURL=compile.mjs.map