mirror of https://github.com/embarklabs/embark.git
fix issue in which some files were not triggered change event
This commit is contained in:
parent
671bf58433
commit
9df0ee9554
|
@ -1,4 +1,5 @@
|
||||||
let chokidar = require('chokidar');
|
let chokidar = require('chokidar');
|
||||||
|
let path = require('path');
|
||||||
|
|
||||||
let fs = require('../core/fs.js');
|
let fs = require('../core/fs.js');
|
||||||
|
|
||||||
|
@ -37,7 +38,16 @@ class Watch {
|
||||||
let filesToWatch = [];
|
let filesToWatch = [];
|
||||||
|
|
||||||
for (let targetFile in appConfig) {
|
for (let targetFile in appConfig) {
|
||||||
filesToWatch.push(appConfig[targetFile]);
|
let files = appConfig[targetFile];
|
||||||
|
let fileGlob = files;
|
||||||
|
|
||||||
|
// workaround for imports issue
|
||||||
|
// so embark reacts to changes made in imported js files
|
||||||
|
if ((!Array.isArray(files) || files.length === 1)) {
|
||||||
|
fileGlob = path.join(path.dirname(files[0]), '**', '*.*');
|
||||||
|
}
|
||||||
|
|
||||||
|
filesToWatch.push(fileGlob);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.watchFiles(
|
this.watchFiles(
|
||||||
|
|
Loading…
Reference in New Issue