mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-15 18:52:51 +03:00
29 lines
651 B
JavaScript
29 lines
651 B
JavaScript
|
#!/usr/bin/env zx
|
||
|
import 'zx/globals';
|
||
|
|
||
|
import * as esbuild from 'esbuild';
|
||
|
|
||
|
import { config } from './common.mjs';
|
||
|
|
||
|
const NODE_ENV =
|
||
|
process.env.NODE_ENV === 'development' ? 'development' : 'production';
|
||
|
|
||
|
async function buildLayers() {
|
||
|
const common = config();
|
||
|
await esbuild.build(common.preload);
|
||
|
|
||
|
await esbuild.build({
|
||
|
...common.main,
|
||
|
define: {
|
||
|
...common.main.define,
|
||
|
'process.env.NODE_ENV': `"${NODE_ENV}"`,
|
||
|
'process.env.BUILD_TYPE': `"${process.env.BUILD_TYPE || 'stable'}"`,
|
||
|
},
|
||
|
});
|
||
|
|
||
|
await $`yarn workspace @affine/electron generate-main-exposed-meta`;
|
||
|
}
|
||
|
|
||
|
await buildLayers();
|
||
|
echo('Build layers done');
|