Skip to content

Commit 6f91984

Browse files
authored
feat: pass current CLI public lib path to webpack env (#5381)
* feat: pass current CLI public lib path to webpack env * feat: export projectConfigService methods
1 parent 233091b commit 6f91984

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/services/project-config-service.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
format as prettierFormat,
2828
resolveConfig as resolvePrettierConfig,
2929
} from "prettier";
30-
import { cache } from "../common/decorators";
30+
import { cache, exported } from "../common/decorators";
3131
import { IOptions } from "../declarations";
3232
import semver = require("semver/preload");
3333
import { ICleanupService } from "../definitions/cleanup-service";
@@ -125,6 +125,7 @@ export default {
125125
};
126126
}
127127

128+
@exported("projectConfigService")
128129
public readConfig(projectDir?: string): INsConfig {
129130
const info = this.detectProjectConfigs(projectDir);
130131

@@ -161,10 +162,12 @@ export default {
161162
return config;
162163
}
163164

165+
@exported("projectConfigService")
164166
public getValue(key: string): any {
165167
return _.get(this.readConfig(), key);
166168
}
167169

170+
@exported("projectConfigService")
168171
public async setValue(
169172
key: string,
170173
value: SupportedConfigValues

lib/services/webpack/webpack-compiler-service.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,15 @@ export class WebpackCompilerService
318318
Object.assign(
319319
envData,
320320
appPath && { appPath },
321-
appResourcesPath && { appResourcesPath }
321+
appResourcesPath && { appResourcesPath },
322+
{
323+
nativescriptLibPath: path.resolve(
324+
__dirname,
325+
"..",
326+
"..",
327+
"nativescript-cli-lib.js"
328+
),
329+
}
322330
);
323331

324332
envData.verbose = envData.verbose || this.$logger.isVerbose();

0 commit comments

Comments
 (0)