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() { function getCLILib() {
if (!env.nativescriptLibPath) { if (!env.nativescriptLibPath) {
if (typeof env.nativescriptLibPath !== 'boolean') {
warnOnce( warnOnce(
'getCLILib', 'getCLILib',
` `
Cannot find NativeScript CLI path. Make sure --env.nativescriptLibPath is passed Cannot find NativeScript CLI path. Make sure --env.nativescriptLibPath is passed
` `
); );
}
return false; 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; appResourcesPath?: string;
appComponents?: string[]; appComponents?: string[];
nativescriptLibPath?: string; nativescriptLibPath?: string | boolean;
android?: boolean; android?: boolean;
ios?: boolean; ios?: boolean;