Skip to content

Commit a61d739

Browse files
committed
fix: Implement backwards compatibility with old versions of nativescript-dev-webpack plugin
1 parent 73c6edd commit a61d739

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

lib/common

lib/services/livesync/livesync-service.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
581581
let filesToRemove: string[] = [];
582582
let timeoutTimer: NodeJS.Timer;
583583

584-
const startSyncFilesTimeout = (platform?: string) => {
584+
const startSyncFilesTimeout = () => {
585585
timeoutTimer = setTimeout(async () => {
586586
if (liveSyncData.syncToPreviewApp) {
587587
await this.addActionToChain(projectData.projectDir, async () => {
@@ -691,12 +691,18 @@ export class LiveSyncService extends EventEmitter implements IDebugLiveSyncServi
691691
},
692692
platforms
693693
},
694+
filesToSync,
694695
filesToSyncMap,
695696
filesToRemove,
696697
startSyncFilesTimeout: async (platform: string) => {
697-
filesToSync = filesToSyncMap[platform];
698-
await startSyncFilesTimeout(platform);
699-
filesToSyncMap[platform] = [];
698+
if (platform) {
699+
filesToSync = filesToSyncMap[platform];
700+
await startSyncFilesTimeout();
701+
filesToSyncMap[platform] = [];
702+
} else {
703+
// This code is added for backwards compatibility with old versions of nativescript-dev-webpack plugin.
704+
await startSyncFilesTimeout();
705+
}
700706
}
701707
}
702708
});

0 commit comments

Comments
 (0)