mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-19 15:14:21 +01:00
Co-authored-by: Nahiyan Khan <nahiyan@squareup.com> Co-authored-by: Taylor Ho <taylorkmho@gmail.com> Co-authored-by: Lily Delalande <119957291+lily-de@users.noreply.github.com> Co-authored-by: Spence <spencrmartin@gmail.com> Co-authored-by: spencrmartin <spencermartin@squareup.com> Co-authored-by: Judson Stephenson <Jud@users.noreply.github.com> Co-authored-by: Max Novich <mnovich@squareup.com> Co-authored-by: Best Codes <106822363+The-Best-Codes@users.noreply.github.com> Co-authored-by: caroline-a-mckenzie <cmckenzie@squareup.com> Co-authored-by: Michael Neale <michael.neale@gmail.com>
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
const { build } = require('vite');
|
|
const { resolve } = require('path');
|
|
const fs = require('fs');
|
|
|
|
async function buildMain() {
|
|
try {
|
|
const outDir = resolve(__dirname, '../.vite/build');
|
|
|
|
// Ensure output directory exists
|
|
if (!fs.existsSync(outDir)) {
|
|
fs.mkdirSync(outDir, { recursive: true });
|
|
}
|
|
|
|
await build({
|
|
configFile: resolve(__dirname, '../vite.main.config.mts'),
|
|
build: {
|
|
outDir,
|
|
emptyOutDir: false,
|
|
ssr: true,
|
|
rollupOptions: {
|
|
input: resolve(__dirname, '../src/main.ts'),
|
|
output: {
|
|
format: 'cjs',
|
|
entryFileNames: 'main.js'
|
|
},
|
|
external: [
|
|
'electron',
|
|
'electron-squirrel-startup',
|
|
'path',
|
|
'fs',
|
|
'url',
|
|
'child_process',
|
|
'crypto',
|
|
'os',
|
|
'util'
|
|
]
|
|
}
|
|
}
|
|
});
|
|
|
|
console.log('Main process build complete');
|
|
} catch (e) {
|
|
console.error('Error building main process:', e);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
buildMain();
|