feat(webpack): allow disabling nativescriptLibPath warning with a boolean

This commit is contained in:
Igor Randjelovic
2022-07-10 11:35:11 +02:00
committed by Nathan Walker
parent 0556cf9b20
commit fefac9f554
2 changed files with 14 additions and 8 deletions

View File

@ -3,16 +3,22 @@ import { env } from '../index';
function getCLILib() {
if (!env.nativescriptLibPath) {
warnOnce(
'getCLILib',
`
Cannot find NativeScript CLI path. Make sure --env.nativescriptLibPath is passed
`
);
if (typeof env.nativescriptLibPath !== 'boolean') {
warnOnce(
'getCLILib',
`
Cannot find NativeScript CLI path. Make sure --env.nativescriptLibPath is passed
`
);
}
return false;
}
return require(env.nativescriptLibPath);
if (typeof env.nativescriptLibPath === 'boolean') {
return false;
}
return require(env.nativescriptLibPath as string);
}
/**

View File

@ -28,7 +28,7 @@ export interface IWebpackEnv {
appResourcesPath?: string;
appComponents?: string[];
nativescriptLibPath?: string;
nativescriptLibPath?: string | boolean;
android?: boolean;
ios?: boolean;