mirror of
https://github.com/n8n-io/n8n.git
synced 2026-08-29 01:39:24 +08:00
ci: Strip non-runtime files from Docker image build (no-changelog) (#35170)
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -218,6 +218,13 @@ for (const pattern of phantomDirs) {
|
||||
}
|
||||
echo(chalk.green('✅ Phantom dirs stripped'));
|
||||
|
||||
// Strip non-runtime files (Node never loads these) to cut the image's file count,
|
||||
// which dominates layer extraction time on constrained hosts. .js.map is kept —
|
||||
// source-map-support needs it for production stack traces.
|
||||
echo(chalk.yellow('INFO: Stripping non-runtime files (.ts/.d.ts/.md) from production closure...'));
|
||||
await $`find ${config.compiledAppDir} \\( -name '*.ts' -o -name '*.d.ts.map' -o -name '*.md' -o -name '*.test.js' -o -name '*.spec.js' \\) -type f -delete 2>/dev/null || true`;
|
||||
echo(chalk.green('✅ Non-runtime files stripped'));
|
||||
|
||||
await fs.ensureDir(config.compiledTaskRunnerDir);
|
||||
|
||||
echo(
|
||||
|
||||
Reference in New Issue
Block a user