Skip to content

Commit a0c5403

Browse files
authored
If controller is started with --preserve-symlinks, pass flags to adapters (#2103)
1 parent db0d213 commit a0c5403

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/common/src/lib/common/tools.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,10 +3155,16 @@ export async function resolveAdapterMainFile(adapter: string): Promise<string> {
31553155
* @returns default node args for cli
31563156
*/
31573157
export function getDefaultNodeArgs(mainFile: string): string[] {
3158+
const ret: string[] = [];
3159+
// Support executing TypeScript files directly
31583160
if (mainFile.endsWith('.ts')) {
3159-
return ['-r', '@alcalzone/esbuild-register'];
3161+
ret.push('-r', '@alcalzone/esbuild-register');
31603162
}
3161-
return [];
3163+
// If JS-controller was started with --preserve-symlinks, do the same for adapters
3164+
if (process.execArgv.includes('--preserve-symlinks')) {
3165+
ret.push('--preserve-symlinks-main', '--preserve-symlinks');
3166+
}
3167+
return ret;
31623168
}
31633169

31643170
/** This is used for the short github URL format that NPM accepts (<githubname>/<githubrepo>[#<commit-ish>]) */

0 commit comments

Comments
 (0)