mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-26 10:45:57 +08:00
chore: add monorepo tools (#9196)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
||||
import { getBuildConfig } from '@affine/cli/src/webpack/runtime-config';
|
||||
import { getBuildConfig } from '@affine-tools/utils/build-config';
|
||||
import { Package } from '@affine-tools/utils/workspace';
|
||||
import { sentryEsbuildPlugin } from '@sentry/esbuild-plugin';
|
||||
import type { BuildOptions, Plugin } from 'esbuild';
|
||||
|
||||
@@ -24,12 +24,10 @@ export const config = (): BuildOptions => {
|
||||
'process.env.NODE_ENV': process.env.NODE_ENV,
|
||||
REPLACE_ME_BUILD_ENV: process.env.BUILD_TYPE ?? 'stable',
|
||||
...Object.entries(
|
||||
getBuildConfig({
|
||||
channel: (process.env.BUILD_TYPE as any) ?? 'canary',
|
||||
distribution: 'desktop',
|
||||
getBuildConfig(new Package('@affine/electron'), {
|
||||
mode:
|
||||
process.env.NODE_ENV === 'production' ? 'production' : 'development',
|
||||
static: false,
|
||||
channel: (process.env.BUILD_TYPE as any) ?? 'canary',
|
||||
})
|
||||
).reduce(
|
||||
(def, [key, val]) => {
|
||||
|
||||
@@ -34,6 +34,7 @@ function spawnOrReloadElectron() {
|
||||
const ext = process.platform === 'win32' ? '.cmd' : '';
|
||||
const exe = resolve(rootDir, 'node_modules', '.bin', `electron${ext}`);
|
||||
|
||||
delete process.env['NODE_OPTIONS'];
|
||||
spawnProcess = spawn(exe, ['.'], {
|
||||
cwd: electronDir,
|
||||
env: process.env,
|
||||
|
||||
Reference in New Issue
Block a user