You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
595 B
JavaScript
17 lines
595 B
JavaScript
import { build } from 'esbuild'
|
|
|
|
await build({
|
|
entryPoints: ['src/server.ts'],
|
|
outfile: 'dist/server.cjs',
|
|
bundle: true,
|
|
platform: 'node',
|
|
format: 'cjs',
|
|
// Native module (better-sqlite3) and puppeteer (locates its browser relative
|
|
// to its own package dir) must stay outside the bundle.
|
|
external: ['better-sqlite3', 'puppeteer'],
|
|
// server.ts falls back to import.meta.url only when __dirname is missing (ESM
|
|
// under vitest/tsx); in this CJS bundle that branch is dead, so the warning is noise.
|
|
logOverride: { 'empty-import-meta': 'silent' },
|
|
})
|
|
console.log('hq built')
|