فهرست منبع

Merge pull request #5536 from payne92/pr_dev

Ignore editor temp files for file watching in dev mode
Steven Silvester 6 سال پیش
والد
کامیت
098bb2dd03
1فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 12 0
      dev_mode/webpack.config.js

+ 12 - 0
dev_mode/webpack.config.js

@@ -49,6 +49,7 @@ Object.keys(jlab.linkedPackages).forEach(function(name) {
   var localPath = require.resolve(path.join(name, 'package.json'));
   localLinked[name] = path.dirname(localPath);
 });
+var ignorePatterns = [/^\.\#/]; // eslint-disable-line
 
 /**
  * Sync a local path to a linked package path if they are files and differ.
@@ -161,6 +162,17 @@ module.exports = [
         if (localPath in ignoreCache) {
           return ignoreCache[localPath];
         }
+
+        // Ignore files with certain patterns
+        var baseName = localPath.replace(/^.*[\\\/]/, ''); // eslint-disable-line
+        if (
+          ignorePatterns.some(function(rexp) {
+            return baseName.match(rexp);
+          })
+        ) {
+          return true;
+        }
+
         // Limit the watched files to those in our local linked package dirs.
         var ignore = true;
         Object.keys(localLinked).some(function(name) {