Skip to content

Commit 4761692

Browse files
committed
Enable live edit on typescript projects
When a typescript file is changed its js.map file is also changed which causes an app restart
1 parent 3a264b4 commit 4761692

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/services/livesync/ios-device-livesync-service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import * as helpers from "../../common/helpers";
2+
import * as constants from "../../constants";
3+
import * as minimatch from "minimatch";
24
import * as net from "net";
35
import Future = require("fibers/future");
46

@@ -75,8 +77,11 @@ class IOSLiveSyncService implements IDeviceLiveSyncService {
7577
this.restartApplication(deviceAppData).wait();
7678
return;
7779
}
80+
let scriptRelatedFiles: Mobile.ILocalToDevicePathData[] = [];
7881
let scriptFiles = _.filter(localToDevicePaths, localToDevicePath => _.endsWith(localToDevicePath.getDevicePath(), ".js"));
79-
let otherFiles = _.difference(localToDevicePaths, scriptFiles);
82+
constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach(pattern => scriptRelatedFiles = _.concat(scriptRelatedFiles, localToDevicePaths.filter(file => minimatch(file.getDevicePath(), pattern, { nocase: true }))));
83+
84+
let otherFiles = _.difference(localToDevicePaths, _.concat(scriptFiles, scriptRelatedFiles));
8085
let shouldRestart = _.some(otherFiles, (localToDevicePath: Mobile.ILocalToDevicePathData) => !this.$liveSyncProvider.canExecuteFastSync(localToDevicePath.getLocalPath(), deviceAppData.platform));
8186

8287
if (shouldRestart) {

0 commit comments

Comments
 (0)