@@ -3,6 +3,8 @@ import * as helpers from "../../common/helpers";
3
3
import * as path from "path" ;
4
4
import * as semver from "semver" ;
5
5
import * as fiberBootstrap from "../../common/fiber-bootstrap" ;
6
+ import { NodeModulesDependenciesBuilder } from "../../tools/node-modules/node-modules-dependencies-builder" ;
7
+
6
8
let choki = require ( "chokidar" ) ;
7
9
8
10
class LiveSyncService implements ILiveSyncService {
@@ -117,11 +119,20 @@ class LiveSyncService implements ILiveSyncService {
117
119
118
120
private partialSync ( syncWorkingDirectory : string , onChangedActions : ( ( event : string , filePath : string , dispatcher : IFutureDispatcher ) => void ) [ ] ) : void {
119
121
let that = this ;
122
+
123
+ let dependenciesBuilder = this . $injector . resolve ( NodeModulesDependenciesBuilder , { } ) ;
124
+ let productionDependencies = dependenciesBuilder . getProductionDependencies ( this . $projectData . projectDir ) ;
120
125
let pattern = [ "app" ] ;
126
+
121
127
if ( this . $options . syncAllFiles ) {
122
128
pattern . push ( "package.json" ) ;
123
- pattern . push ( "node_modules" ) ;
129
+
130
+ // watch only production node_module/packages same one prepare uses
131
+ for ( var index in productionDependencies ) {
132
+ pattern . push ( "node_modules/" + productionDependencies [ index ] . name ) ;
133
+ }
124
134
}
135
+
125
136
let watcher = choki . watch ( pattern , { ignoreInitial : true , cwd : syncWorkingDirectory } ) . on ( "all" , ( event : string , filePath : string ) => {
126
137
fiberBootstrap . run ( ( ) => {
127
138
that . $dispatcher . dispatch ( ( ) => ( ( ) => {
0 commit comments