13 lines
674 B
JavaScript
13 lines
674 B
JavaScript
import { packager } from '@electron/packager';
|
|
const options = Object.fromEntries(process.argv.slice(2).map(arg => {
|
|
const match = /^--(platform|arch)=(win32|linux|x64|arm64)$/.exec(arg);
|
|
if (!match) throw new Error('Use --platform=win32|linux and --arch=x64|arm64.');
|
|
return [match[1], match[2]];
|
|
}));
|
|
const outputs = await packager({
|
|
dir: '.', name: 'RuneStone-Browser', out: 'dist', overwrite: true,
|
|
platform: options.platform || process.platform, arch: options.arch || process.arch,
|
|
ignore: [/^\/(test|scripts|output|plugin|releases|\.github)(\/|$)/, /^\/src\/(ui\/|host\.mjs|main\.mjs|preload\.cjs)/],
|
|
});
|
|
for (const output of outputs) console.log(output);
|