Skip to content

Commit a219b87

Browse files
committed
node_modules is not watched by default
If you want to watch for changes in node_modules or package.json a --sync-all-files or --syncAllFiles flag needs to be passed. By default only the app/ folder is being watched during any livesync.
1 parent dac7acd commit a219b87

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class Options extends commonOptionsLibPath.OptionsBase {
3939
bundle: { type: OptionType.Boolean },
4040
all: { type: OptionType.Boolean },
4141
teamId: { type: OptionType.String },
42-
syncAllFiles: { type: OptionType.Boolean, default: true },
42+
syncAllFiles: { type: OptionType.Boolean, default: false },
4343
liveEdit: { type: OptionType.Boolean },
4444
chrome: { type: OptionType.Boolean },
4545
clean: { type: OptionType.Boolean },

lib/services/livesync/livesync-service.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ class LiveSyncService implements ILiveSyncService {
117117

118118
private partialSync(syncWorkingDirectory: string, onChangedActions: ((event: string, filePath: string, dispatcher: IFutureDispatcher) => void )[]): void {
119119
let that = this;
120-
let pattern = ["app", "package.json", "node_modules"];
120+
let pattern = ["app"];
121+
if(this.$options.syncAllFiles) {
122+
pattern.push("package.json");
123+
pattern.push("node_modules");
124+
}
121125
let watcher = choki.watch(pattern, { ignoreInitial: true, cwd: syncWorkingDirectory }).on("all", (event: string, filePath: string) => {
122126
fiberBootstrap.run(() => {
123127
that.$dispatcher.dispatch(() => (() => {

0 commit comments

Comments
 (0)