mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
build(electron): allow customizing channel type for internal build (#4511)
This commit is contained in:
@@ -15,12 +15,21 @@ if (process.platform === 'win32') {
|
||||
|
||||
async function buildLayers() {
|
||||
const common = config();
|
||||
|
||||
const define = {
|
||||
'process.env.NODE_ENV': `"${NODE_ENV}"`,
|
||||
'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.layers,
|
||||
define: {
|
||||
'process.env.NODE_ENV': `"${NODE_ENV}"`,
|
||||
'process.env.BUILD_TYPE': `"${process.env.BUILD_TYPE || 'stable'}"`,
|
||||
},
|
||||
define: define,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ if (!process.env.SKIP_WEB_BUILD) {
|
||||
await $`yarn -T run build:plugins`;
|
||||
await $`yarn nx build @affine/core`;
|
||||
|
||||
await $`yarn workspace @affine/electron build`;
|
||||
|
||||
// step 1.5: amend sourceMappingURL to allow debugging in devtools
|
||||
await glob('**/*.{js,css}', { cwd: affineCoreOutDir }).then(files => {
|
||||
return files.map(async file => {
|
||||
|
||||
Reference in New Issue
Block a user