Files
my-protfolio/scripts/build-maintenance.mjs
Amirhossein Khalili 9f749e7d81
Some checks failed
Test and deploy / Verify production build (push) Failing after 15m22s
fix: bundle maintenance CLI JavaScript dependencies
Include Drizzle, validation, and password hashing dependencies in the CLI instead of relying on Next standalone tracing. Keep native SQLite and Sharp external and provide CommonJS require compatibility within the ESM bundle. Verification skipped as requested.
2026-09-15 23:51:11 +03:30

17 lines
566 B
JavaScript

import { build } from 'esbuild';
await build({
entryPoints: ['scripts/maintenance.ts'],
outfile: '.next/standalone/maintenance.mjs',
bundle: true,
platform: 'node',
target: 'node22',
format: 'esm',
// Next traces the web application, not this separate maintenance entry point.
// Bundle its JS dependencies; only native packages stay external.
external: ['better-sqlite3', 'sharp'],
banner: {
js: "import { createRequire as createMaintenanceRequire } from 'node:module'; const require = createMaintenanceRequire(import.meta.url);",
},
});