Skip to content

Commit

Permalink
fix: add webpack env data so that scripts can read it (#5817)
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug authored Dec 27, 2024
1 parent 5e381d4 commit bc23679
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/services/webpack/webpack-compiler-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,16 @@ export class WebpackCompilerService
cwd: projectData.projectDir,
stdio,
};

options.env = {
NATIVESCRIPT_WEBPACK_ENV:JSON.stringify(envData)
}
if (this.$options.hostProjectPath) {
options.env = {
Object.assign(options.env, {
USER_PROJECT_PLATFORMS_ANDROID: this.$options.hostProjectPath,
USER_PROJECT_PLATFORMS_ANDROID_MODULE:
this.$options.hostProjectModuleName,
USER_PROJECT_PLATFORMS_IOS: this.$options.hostProjectPath,
};
});
}

const childProcess = this.$childProcess.spawn(
Expand Down

0 comments on commit bc23679

Please sign in to comment.