Skip to content

Commit bc23679

Browse files
authored
fix: add webpack env data so that scripts can read it (#5817)
1 parent 5e381d4 commit bc23679

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,16 @@ export class WebpackCompilerService
354354
cwd: projectData.projectDir,
355355
stdio,
356356
};
357-
357+
options.env = {
358+
NATIVESCRIPT_WEBPACK_ENV:JSON.stringify(envData)
359+
}
358360
if (this.$options.hostProjectPath) {
359-
options.env = {
361+
Object.assign(options.env, {
360362
USER_PROJECT_PLATFORMS_ANDROID: this.$options.hostProjectPath,
361363
USER_PROJECT_PLATFORMS_ANDROID_MODULE:
362364
this.$options.hostProjectModuleName,
363365
USER_PROJECT_PLATFORMS_IOS: this.$options.hostProjectPath,
364-
};
366+
});
365367
}
366368

367369
const childProcess = this.$childProcess.spawn(

0 commit comments

Comments
 (0)