Browse Source

ignore requiring 'locales/index.js' when dev

Yuki Takei 8 years ago
parent
commit
5b0f40eb1f
1 changed files with 7 additions and 3 deletions
  1. 7 3
      lib/crowi/dev.js

+ 7 - 3
lib/crowi/dev.js

@@ -41,9 +41,13 @@ class CrowiDev {
    */
    */
   requireForAutoReloadServer() {
   requireForAutoReloadServer() {
     // load all json files for live reloading
     // load all json files for live reloading
-    fs.readdirSync(this.crowi.localeDir).map((dirname) => {
-      require(path.join(this.crowi.localeDir, dirname, 'translation.json'));
-    });
+    fs.readdirSync(this.crowi.localeDir)
+      .filter(filename => {
+        return fs.statSync(path.join(this.crowi.localeDir, filename)).isDirectory();
+      })
+      .map((dirname) => {
+        require(path.join(this.crowi.localeDir, dirname, 'translation.json'));
+      });
   }
   }
 
 
   /**
   /**