fix: bundle maintenance CLI JavaScript dependencies
Some checks failed
Test and deploy / Verify production build (push) Failing after 15m22s
Some checks failed
Test and deploy / Verify production build (push) Failing after 15m22s
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.
This commit is contained in:
@@ -1,2 +1,16 @@
|
||||
import { build } from 'esbuild';
|
||||
await build({ entryPoints: ['scripts/maintenance.ts'], outfile: '.next/standalone/maintenance.mjs', bundle: true, platform: 'node', target: 'node22', format: 'esm', packages: 'external' });
|
||||
|
||||
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);",
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user