mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 11:58:41 +00:00
test: add electron test (#1840)
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
const NODE_MAJOR_VERSION = 18;
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
export const root = fileURLToPath(new URL('..', import.meta.url));
|
||||
export const NODE_MAJOR_VERSION = 18;
|
||||
|
||||
const nativeNodeModulesPlugin = {
|
||||
name: 'native-node-modules',
|
||||
@@ -14,7 +19,7 @@ const nativeNodeModulesPlugin = {
|
||||
const ENV_MACROS = ['AFFINE_GOOGLE_CLIENT_ID', 'AFFINE_GOOGLE_CLIENT_SECRET'];
|
||||
|
||||
/** @return {{main: import('esbuild').BuildOptions, preload: import('esbuild').BuildOptions}} */
|
||||
export default () => {
|
||||
export const config = () => {
|
||||
const define = Object.fromEntries(
|
||||
ENV_MACROS.map(key => [
|
||||
'process.env.' + key,
|
||||
@@ -23,8 +28,8 @@ export default () => {
|
||||
);
|
||||
return {
|
||||
main: {
|
||||
entryPoints: ['layers/main/src/index.ts'],
|
||||
outdir: 'dist/layers/main',
|
||||
entryPoints: [resolve(root, './layers/main/src/index.ts')],
|
||||
outdir: resolve(root, './dist/layers/main'),
|
||||
bundle: true,
|
||||
target: `node${NODE_MAJOR_VERSION}`,
|
||||
platform: 'node',
|
||||
@@ -33,8 +38,8 @@ export default () => {
|
||||
define: define,
|
||||
},
|
||||
preload: {
|
||||
entryPoints: ['layers/preload/src/index.ts'],
|
||||
outdir: 'dist/layers/preload',
|
||||
entryPoints: [resolve(root, './layers/preload/src/index.ts')],
|
||||
outdir: resolve(root, './dist/layers/preload'),
|
||||
bundle: true,
|
||||
target: `node${NODE_MAJOR_VERSION}`,
|
||||
platform: 'node',
|
||||
|
||||
Reference in New Issue
Block a user