diff --git a/lib/services/project-config-service.ts b/lib/services/project-config-service.ts index fb957e1054..bfd0856e83 100644 --- a/lib/services/project-config-service.ts +++ b/lib/services/project-config-service.ts @@ -27,7 +27,7 @@ import { format as prettierFormat, resolveConfig as resolvePrettierConfig, } from "prettier"; -import { cache } from "../common/decorators"; +import { cache, exported } from "../common/decorators"; import { IOptions } from "../declarations"; import semver = require("semver/preload"); @@ -123,6 +123,7 @@ export default { }; } + @exported("projectConfigService") public readConfig(projectDir?: string): INsConfig { const info = this.detectProjectConfigs(projectDir); @@ -159,10 +160,12 @@ export default { return config; } + @exported("projectConfigService") public getValue(key: string): any { return _.get(this.readConfig(), key); } + @exported("projectConfigService") public async setValue( key: string, value: SupportedConfigValues diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 91d05633f6..3889ca6b75 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -318,7 +318,15 @@ export class WebpackCompilerService Object.assign( envData, appPath && { appPath }, - appResourcesPath && { appResourcesPath } + appResourcesPath && { appResourcesPath }, + { + nativescriptLibPath: path.resolve( + __dirname, + "..", + "..", + "nativescript-cli-lib.js" + ), + } ); envData.verbose = envData.verbose || this.$logger.isVerbose();