File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11let chokidar = require ( 'chokidar' ) ;
22let path = require ( 'path' ) ;
3+ const _ = require ( 'underscore' ) ;
34
45let fs = require ( '../core/fs.js' ) ;
56
@@ -57,14 +58,16 @@ class Watch {
5758
5859 // workaround for imports issue
5960 // so embark reacts to changes made in imported js files
61+ // chokidar glob patterns only work with front-slashes
6062 if ( ! Array . isArray ( files ) ) {
61- fileGlob = path . join ( path . dirname ( files ) , '**' , '*.*' ) ;
63+ fileGlob = path . join ( path . dirname ( files ) , '**' , '*.*' ) . replace ( / \\ / g , '/' ) ;
6264 } else if ( files . length === 1 ) {
63- fileGlob = path . join ( path . dirname ( files [ 0 ] ) , '**' , '*.*' ) ;
65+ fileGlob = path . join ( path . dirname ( files [ 0 ] ) , '**' , '*.*' ) . replace ( / \\ / g , '/' ) ;
6466 }
6567
6668 filesToWatch . push ( fileGlob ) ;
6769 }
70+ filesToWatch = _ . uniq ( filesToWatch ) ;
6871
6972 this . watchFiles (
7073 filesToWatch ,
You can’t perform that action at this time.
0 commit comments