Make Electron build
I historically have never liked Electron, and I don't like it now, but unfortunately due to poor browser support, I don't have a choice to ship anything more lightweight if I want to use the Filesystem API as part of the packaged build, which is kind of the point. I guess it's true: "You either die a hero or you live long enough to become the villain." This is an experimental build.
This commit is contained in:
16
electron/copy-dist.mjs
Normal file
16
electron/copy-dist.mjs
Normal file
@@ -0,0 +1,16 @@
|
||||
import { cpSync, rmSync, existsSync } from 'node:fs';
|
||||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const dir = dirname(fileURLToPath(import.meta.url));
|
||||
const src = join(dir, '..', 'web', 'dist');
|
||||
const dst = join(dir, 'dist');
|
||||
|
||||
if (!existsSync(src)) {
|
||||
console.error('web/dist/ does not exist — run "cd web && npm run build" first.');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
rmSync(dst, { recursive: true, force: true });
|
||||
cpSync(src, dst, { recursive: true });
|
||||
console.log(`Copied ${src} -> ${dst}`);
|
||||
Reference in New Issue
Block a user