From 7bec1a62904f63378d0c66cb1540e21099826e40 Mon Sep 17 00:00:00 2001 From: jeasonnow Date: Tue, 4 Jul 2023 18:06:30 +0800 Subject: [PATCH] fix: absolute inject file path support --- bin/helpers/merge.ts | 2 +- src-tauri/tauri.macos.conf.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/helpers/merge.ts b/bin/helpers/merge.ts index 1d8f1fc..2d3fd55 100644 --- a/bin/helpers/merge.ts +++ b/bin/helpers/merge.ts @@ -190,7 +190,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon logger.error('The injected file must be in either CSS or JS format.'); return; } - const files = inject.map(relativePath => path.join(process.cwd(), relativePath)); + const files = inject.map(filepath => path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)); tauriConf.pake.inject = files; await combineFiles(files, path.join(npmDirectory, `src-tauri/src/inject/_INJECT_.js`)); } diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index f8cce2a..8294815 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -19,4 +19,5 @@ "shortDescription": "", "targets": ["dmg"] } -} + } +} \ No newline at end of file