farmcontrol-server/scripts/build-linux-bundle.mjs
Tom Butcher 55b4c1a42e
All checks were successful
farmcontrol/farmcontrol-server/pipeline/head This commit looks good
Add PDF conversion utilities and update build scripts for Linux packaging
Introduce a new pdfUtils.js file for on-demand PDF conversion using pdf-to-img and sharp. Update package.json to include new build scripts for Linux packaging, enhancing the build process with public package handling. Add .npmrc for public hoisting patterns and create build-linux-packages.sh for streamlined package creation.
2026-07-26 21:47:21 +01:00

28 lines
655 B
JavaScript

import * as esbuild from 'esbuild'
import { fileURLToPath } from 'node:url'
import path from 'node:path'
const rootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
await esbuild.build({
entryPoints: [path.join(rootDir, 'src/headless.js')],
bundle: true,
platform: 'node',
target: 'node18',
format: 'cjs',
outfile: path.join(rootDir, 'build/pkg-entry.cjs'),
external: [
'electron',
'sharp',
'canvas',
'@napi-rs/canvas',
'pdf-to-img',
'pdfjs-dist'
],
inject: [path.join(rootDir, 'scripts/import-meta-url.js')],
define: {
'import.meta.url': 'import_meta_url'
},
logLevel: 'info'
})