mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
Bundle preload.ts into a single file so all local imports (e.g. ipc-events.const) are inlined at build time. This allows removing sandbox: false since the bundled preload only requires the built-in electron module, which is allowed in sandboxed preloads.
15 lines
381 B
JavaScript
15 lines
381 B
JavaScript
#!/usr/bin/env node
|
|
const { build } = require('esbuild');
|
|
const path = require('path');
|
|
|
|
build({
|
|
entryPoints: [path.join(__dirname, '..', 'preload.ts')],
|
|
bundle: true,
|
|
outfile: path.join(__dirname, '..', 'preload.js'),
|
|
platform: 'node',
|
|
target: 'es2022',
|
|
format: 'cjs',
|
|
external: ['electron'],
|
|
sourcemap: false,
|
|
logLevel: 'info',
|
|
}).catch(() => process.exit(1));
|