mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
feat: electron app (#1586)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const __dirname = new URL('.', import.meta.url).pathname;
|
||||
|
||||
const { node } = JSON.parse(
|
||||
fs.readFileSync(
|
||||
path.join(__dirname, '../electron-vendors.autogen.json'),
|
||||
'utf-8'
|
||||
)
|
||||
);
|
||||
|
||||
/** @type {import('esbuild').BuildOptions} */
|
||||
export const mainConfig = {
|
||||
entryPoints: ['layers/main/src/index.ts'],
|
||||
outdir: 'dist/layers/main',
|
||||
bundle: true,
|
||||
target: `node${node}`,
|
||||
platform: 'node',
|
||||
external: ['electron'],
|
||||
};
|
||||
|
||||
export const preloadConfig = {
|
||||
entryPoints: ['layers/preload/src/index.ts'],
|
||||
outdir: 'dist/layers/preload',
|
||||
bundle: true,
|
||||
target: `node${node}`,
|
||||
platform: 'node',
|
||||
external: ['electron'],
|
||||
};
|
||||
Reference in New Issue
Block a user