Preview-Build installiert devDependencies (Fall Anelia-Wolf/Next 16)
Der Server-Container laeuft mit NODE_ENV=production, dadurch setzt npm automatisch omit=dev. Build-Toolchains wie Next, Vite, Tailwind oder TypeScript stehen aber in den devDependencies, weshalb jeder node_build mit "Cannot find module ..." abbrach und die Preview auf den statischen Platzhalter zurueckfiel. npm ci/npm install laufen jetzt mit --include=dev. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -250,11 +250,15 @@ async function deployNodeBuild(sourceDir, targetDir) {
|
||||
timeout: 15 * 60 * 1000,
|
||||
env: { ...process.env, CI: '1' },
|
||||
}
|
||||
// Der Server-Container laeuft mit NODE_ENV=production, dadurch setzt npm
|
||||
// automatisch omit=dev. Die Build-Toolchain (Next, Vite, Tailwind, TypeScript)
|
||||
// steht aber in den devDependencies -> ohne "--include=dev" bricht jeder
|
||||
// Build mit "Cannot find module ..." ab (Fall Anelia-Wolf/Next 16).
|
||||
try {
|
||||
await execFileAsync('npm', ['ci'], execOpts)
|
||||
await execFileAsync('npm', ['ci', '--include=dev'], execOpts)
|
||||
} catch {
|
||||
// Ohne (passendes) package-lock.json schlaegt npm ci fehl -> npm install.
|
||||
await execFileAsync('npm', ['install', '--no-audit', '--no-fund'], execOpts)
|
||||
await execFileAsync('npm', ['install', '--include=dev', '--no-audit', '--no-fund'], execOpts)
|
||||
}
|
||||
await execFileAsync('npm', ['run', 'build'], execOpts)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user