Skip to content

Commit af70f1e

Browse files
authored
applied hotfix in master (#2494)
* applied hotfix in master fix for #2469 applied in master not with cherry picking, because it would be too much of a murge hasste because of fibers refactoring * made lint happy
1 parent 11fc089 commit af70f1e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class Options extends commonOptionsLibPath.OptionsBase {
3636
bundle: { type: OptionType.Boolean },
3737
all: { type: OptionType.Boolean },
3838
teamId: { type: OptionType.String },
39-
syncAllFiles: { type: OptionType.Boolean, default: true },
39+
syncAllFiles: { type: OptionType.Boolean, default: false },
4040
liveEdit: { type: OptionType.Boolean },
4141
chrome: { type: OptionType.Boolean },
4242
clean: { type: OptionType.Boolean },

lib/services/livesync/livesync-service.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import * as constants from "../../constants";
22
import * as helpers from "../../common/helpers";
33
import * as path from "path";
44
import * as semver from "semver";
5+
import { NodeModulesDependenciesBuilder } from "../../tools/node-modules/node-modules-dependencies-builder";
6+
57
let choki = require("chokidar");
68

79
class LiveSyncService implements ILiveSyncService {
@@ -118,7 +120,19 @@ class LiveSyncService implements ILiveSyncService {
118120

119121
private partialSync(syncWorkingDirectory: string, onChangedActions: ((event: string, filePath: string, dispatcher: IFutureDispatcher) => Promise<void>)[]): void {
120122
let that = this;
121-
let pattern = ["app", "package.json", "node_modules"];
123+
let dependenciesBuilder = this.$injector.resolve(NodeModulesDependenciesBuilder, {});
124+
let productionDependencies = dependenciesBuilder.getProductionDependencies(this.$projectData.projectDir);
125+
let pattern = ["app"];
126+
127+
if (this.$options.syncAllFiles) {
128+
pattern.push("package.json");
129+
130+
// watch only production node_module/packages same one prepare uses
131+
for (let index in productionDependencies) {
132+
pattern.push("node_modules/" + productionDependencies[index].name);
133+
}
134+
}
135+
122136
let watcher = choki.watch(pattern, { ignoreInitial: true, cwd: syncWorkingDirectory, ignored: '**/*.DS_Store' }).on("all", (event: string, filePath: string) => {
123137
that.$dispatcher.dispatch(async () => {
124138
try {

0 commit comments

Comments
 (0)