Skip to content

Commit 9ad505b

Browse files
authored
Merge pull request #4757 from NativeScript/fatme/fix-run
fix: fix run command when no platform is provided
2 parents 6d274fe + 8f8ec09 commit 9ad505b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/controllers/prepare-controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ export class PrepareController extends EventEmitter {
102102
private async startJSWatcherWithPrepare(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise<void> {
103103
if (!this.watchersData[projectData.projectDir][platformData.platformNameLowerCase].webpackCompilerProcess) {
104104
this.$webpackCompilerService.on(WEBPACK_COMPILATION_COMPLETE, data => {
105-
this.emitPrepareEvent({ ...data, hasNativeChanges: false, platform: platformData.platformNameLowerCase });
105+
if (data.platform.toLowerCase() === platformData.platformNameLowerCase) {
106+
this.emitPrepareEvent({ ...data, hasNativeChanges: false });
107+
}
106108
});
107109

108110
const childProcess = await this.$webpackCompilerService.compileWithWatch(platformData, projectData, prepareData);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ export class WebpackCompilerService extends EventEmitter implements IWebpackComp
6060
hmrData: {
6161
hash: result.hash,
6262
fallbackFiles
63-
}
63+
},
64+
platform: platformData.platformNameLowerCase
6465
};
6566

6667
if (data.files.length) {

0 commit comments

Comments
 (0)