Skip to content

Commit fefac9f

Browse files
rigor789NathanWalker
authored andcommitted
feat(webpack): allow disabling nativescriptLibPath warning with a boolean
1 parent 0556cf9 commit fefac9f

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎packages/webpack5/src/helpers/config.ts‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,22 @@ import { env } from '../index';
33

44
function getCLILib() {
55
if (!env.nativescriptLibPath) {
6-
warnOnce(
7-
'getCLILib',
8-
`
9-
Cannot find NativeScript CLI path. Make sure --env.nativescriptLibPath is passed
10-
`
11-
);
6+
if (typeof env.nativescriptLibPath !== 'boolean') {
7+
warnOnce(
8+
'getCLILib',
9+
`
10+
Cannot find NativeScript CLI path. Make sure --env.nativescriptLibPath is passed
11+
`
12+
);
13+
}
14+
return false;
15+
}
16+
17+
if (typeof env.nativescriptLibPath === 'boolean') {
1218
return false;
1319
}
1420

15-
return require(env.nativescriptLibPath);
21+
return require(env.nativescriptLibPath as string);
1622
}
1723

1824
/**

‎packages/webpack5/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface IWebpackEnv {
2828
appResourcesPath?: string;
2929
appComponents?: string[];
3030

31-
nativescriptLibPath?: string;
31+
nativescriptLibPath?: string | boolean;
3232

3333
android?: boolean;
3434
ios?: boolean;

0 commit comments

Comments
 (0)