Skip to content

Commit

Permalink
applied hotfix in master (#2494)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Plamen5kov authored Feb 6, 2017
1 parent 11fc089 commit af70f1e
Show file tree
Hide file tree
Showing 2 changed files with 16 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 @@ -36,7 +36,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
16 changes: 15 additions & 1 deletion lib/services/livesync/livesync-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as constants from "../../constants";
import * as helpers from "../../common/helpers";
import * as path from "path";
import * as semver from "semver";
import { NodeModulesDependenciesBuilder } from "../../tools/node-modules/node-modules-dependencies-builder";

let choki = require("chokidar");

class LiveSyncService implements ILiveSyncService {
Expand Down Expand Up @@ -118,7 +120,19 @@ class LiveSyncService implements ILiveSyncService {

private partialSync(syncWorkingDirectory: string, onChangedActions: ((event: string, filePath: string, dispatcher: IFutureDispatcher) => Promise<void>)[]): void {
let that = this;
let pattern = ["app", "package.json", "node_modules"];
let dependenciesBuilder = this.$injector.resolve(NodeModulesDependenciesBuilder, {});
let productionDependencies = dependenciesBuilder.getProductionDependencies(this.$projectData.projectDir);
let pattern = ["app"];

if (this.$options.syncAllFiles) {
pattern.push("package.json");

// watch only production node_module/packages same one prepare uses
for (let index in productionDependencies) {
pattern.push("node_modules/" + productionDependencies[index].name);
}
}

let watcher = choki.watch(pattern, { ignoreInitial: true, cwd: syncWorkingDirectory, ignored: '**/*.DS_Store' }).on("all", (event: string, filePath: string) => {
that.$dispatcher.dispatch(async () => {
try {
Expand Down

0 comments on commit af70f1e

Please sign in to comment.