Skip to content

Commit

Permalink
node_modules is not watched by default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Plamen5kov committed Feb 3, 2017
1 parent 99e1ad6 commit 706a86d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class Options extends commonOptionsLibPath.OptionsBase {
bundle: { type: OptionType.Boolean },
all: { type: OptionType.Boolean },
teamId: { type: OptionType.String },
syncAllFiles: { type: OptionType.Boolean, default: true },
syncAllFiles: { type: OptionType.Boolean, default: false },
liveEdit: { type: OptionType.Boolean },
chrome: { type: OptionType.Boolean },
clean: { type: OptionType.Boolean },
Expand Down
6 changes: 5 additions & 1 deletion lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ class LiveSyncService implements ILiveSyncService {

private partialSync(syncWorkingDirectory: string, onChangedActions: ((event: string, filePath: string, dispatcher: IFutureDispatcher) => void )[]): void {
let that = this;
let pattern = ["app", "package.json", "node_modules"];
let pattern = ["app"];
if(this.$options.syncAllFiles) {
pattern.push("package.json");
pattern.push("node_modules");
}
let watcher = choki.watch(pattern, { ignoreInitial: true, cwd: syncWorkingDirectory }).on("all", (event: string, filePath: string) => {
fiberBootstrap.run(() => {
that.$dispatcher.dispatch(() => (() => {
Expand Down

0 comments on commit 706a86d

Please sign in to comment.