fix: absolute inject file path support

This commit is contained in:
jeasonnow
2023-07-04 18:06:30 +08:00
parent 96edb6fe88
commit 7bec1a6290
2 changed files with 3 additions and 2 deletions

View File

@@ -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`));
}

View File

@@ -19,4 +19,5 @@
"shortDescription": "",
"targets": ["dmg"]
}
}
}
}