code: function watchConfigForNei(configFilePaths, server, targetDir) {
    console.log('开始监听配置文件：' + configFilePaths);
    configFilePaths.forEach(it => {
      try {
        fs.watchFile(it, function (event) {
          if (server) {
            console.log('配置文件变化：' + it);
  
            let routesAll = {};
            let temp = {};
            configFilePaths.forEach(e => {
              try {
                delete require.cache[require.resolve(e)];
                temp = require(e);
                Object.assign(routesAll, temp.routes);
              } catch (e) {
                logger.error(`找不到文件${e}`);
              }
            });
            temp.routes = routesAll;
  
            let options = wrapOptionsForNei(temp, targetDir);
            server.reset(options);
          }
        });
      } catch (err) {
        console.error('监听配置文件变化异常，请查看配置文件是否正确');
      }
  
    })
  }
docs: 监听nei配置文件变化