All checks were successful
farmcontrol/farmcontrol-server/pipeline/head This commit looks good
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.
28 lines
655 B
JavaScript
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'
|
|
})
|