From 5176d57d28ff4c9bd7afc6950099ee4a266ae23a Mon Sep 17 00:00:00 2001 From: linonetwo Date: Wed, 8 Feb 2023 23:16:12 +0800 Subject: [PATCH] fix: preload script in tauri should not have `export` --- client-app/src-tauri/tauri.conf.json | 2 +- client-app/src/preload/index.ts | 9 --------- client-app/src/preload/type.ts | 8 ++++++++ 3 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 client-app/src/preload/type.ts diff --git a/client-app/src-tauri/tauri.conf.json b/client-app/src-tauri/tauri.conf.json index 677d79f0ab..28267da132 100644 --- a/client-app/src-tauri/tauri.conf.json +++ b/client-app/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "build": { "beforeDevCommand": "pnpm dev:prerequisite", - "beforeBuildCommand": "pnpm build:web && pnpm build:affine && pnpm build:preload", + "beforeBuildCommand": "pnpm build:web && pnpm build:preload && pnpm build:affine && pnpm build:preload", "devPath": "http://localhost:8080", "distDir": "../dist", "withGlobalTauri": false diff --git a/client-app/src/preload/index.ts b/client-app/src/preload/index.ts index 8c0adf5c5c..31202e1006 100644 --- a/client-app/src/preload/index.ts +++ b/client-app/src/preload/index.ts @@ -16,12 +16,3 @@ function setEnvironmentVariables() { } setEnvironmentVariables(); - -declare global { - interface Window { - CLIENT_APP?: boolean; - __editoVersion?: string; - } -} - -export {}; diff --git a/client-app/src/preload/type.ts b/client-app/src/preload/type.ts new file mode 100644 index 0000000000..9e71ac5b62 --- /dev/null +++ b/client-app/src/preload/type.ts @@ -0,0 +1,8 @@ +declare global { + interface Window { + CLIENT_APP?: boolean; + __editoVersion?: string; + } +} + +export {};