mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-11-23 16:22:21 +03:00
30 lines
774 B
JavaScript
30 lines
774 B
JavaScript
|
import { resolve } from 'node:path';
|
||
|
import { fileURLToPath } from 'node:url';
|
||
|
|
||
|
export const rootDir = fileURLToPath(new URL('../..', import.meta.url));
|
||
|
export const electronOutputDir = resolve(
|
||
|
rootDir,
|
||
|
'apps',
|
||
|
'electron',
|
||
|
'dist',
|
||
|
'plugins'
|
||
|
);
|
||
|
export const pluginDir = resolve(rootDir, 'plugins');
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
* @param pluginDirName {string}
|
||
|
* @return {import('esbuild').BuildOptions}
|
||
|
*/
|
||
|
export function definePluginServerConfig(pluginDirName) {
|
||
|
const pluginRootDir = resolve(pluginDir, pluginDirName);
|
||
|
const serverEntryFile = resolve(pluginRootDir, 'src/server.ts');
|
||
|
const serverOutputDir = resolve(electronOutputDir, pluginDirName);
|
||
|
return {
|
||
|
entryPoints: [serverEntryFile],
|
||
|
platform: 'node',
|
||
|
outdir: serverOutputDir,
|
||
|
bundle: true,
|
||
|
};
|
||
|
}
|