Insole-production time tracker exported from the Create/Anything AI platform. Baseline snapshot before any reverse-engineering or cleanup. - apps/mobile: Expo Router app (iOS/Android/web), the only workspace - publisher/: standalone OpenNext/AWS deploy tooling for the web side - Backend (/api/tasks, /api/logs + DB) lives remotely, not in this repo
36 lines
856 B
JavaScript
36 lines
856 B
JavaScript
import { spawnSync } from 'node:child_process';
|
|
import { readFileSync } from 'node:fs';
|
|
|
|
function getBuildScript() {
|
|
try {
|
|
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));
|
|
return typeof packageJson.scripts?.build === 'string'
|
|
? packageJson.scripts.build
|
|
: '';
|
|
} catch {
|
|
return '';
|
|
}
|
|
}
|
|
|
|
const buildScript = getBuildScript();
|
|
const shouldForceWebpack =
|
|
/\bnext\s+build\b/.test(buildScript) &&
|
|
!/\s--(?:webpack|turbopack)(?:\s|$)/.test(buildScript);
|
|
const args = shouldForceWebpack ? ['build', '--webpack'] : ['build'];
|
|
|
|
const result = spawnSync('yarn', args, {
|
|
stdio: 'inherit',
|
|
});
|
|
|
|
if (result.error) {
|
|
console.error(result.error);
|
|
process.exit(1);
|
|
}
|
|
|
|
if (result.signal) {
|
|
console.error(`Build command terminated by ${result.signal}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
process.exit(result.status ?? 1);
|