mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-12 17:23:28 +03:00
7c2574b1ca
Co-authored-by: Himself65 <himself65@outlook.com>
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');
|