mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 02:13:00 +08:00
refactor(infra): directory structure (#4615)
This commit is contained in:
26
packages/frontend/electron/scripts/build-layers.ts
Normal file
26
packages/frontend/electron/scripts/build-layers.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import * as esbuild from 'esbuild';
|
||||
|
||||
import { config, mode } from './common';
|
||||
|
||||
async function buildLayers() {
|
||||
const common = config();
|
||||
|
||||
const define: Record<string, string> = {
|
||||
'process.env.NODE_ENV': `"${mode}"`,
|
||||
'process.env.BUILD_TYPE': `"${process.env.BUILD_TYPE || 'stable'}"`,
|
||||
};
|
||||
|
||||
if (process.env.BUILD_TYPE_OVERRIDE) {
|
||||
define[
|
||||
'process.env.BUILD_TYPE_OVERRIDE'
|
||||
] = `"${process.env.BUILD_TYPE_OVERRIDE}"`;
|
||||
}
|
||||
|
||||
await esbuild.build({
|
||||
...common,
|
||||
define: define,
|
||||
});
|
||||
}
|
||||
|
||||
await buildLayers();
|
||||
console.log('Build layers done');
|
||||
Reference in New Issue
Block a user