Javascript 重新加载页面时角度应用程序中的Grunt URL重写

Javascript 重新加载页面时角度应用程序中的Grunt URL重写,javascript,angular,gruntjs,legacy,Javascript,Angular,Gruntjs,Legacy,下面是Grunt文件中livereload块的外观: livereload: { options: { open: true, middleware: function(connect, options, middleware) { var optBase = typeof options.base === "string" ? [options.base] : options.base; return [

下面是Grunt文件中livereload块的外观:

livereload: {
  options: {
    open: true,
    middleware: function(connect, options, middleware) {
      var optBase = typeof options.base === "string" 
        ? [options.base] 
        : options.base;

      return [
        [
          require("connect-modrewrite")(["!(\\..+)$ / [L]"])
        ].concat(
          optBase.map(function(path) { return connect.static(path); })
        ),
        connect.static(".tmp"),
        connect().use("/bower_components", connect.static("./bower_components")),
        connect().use("/app/styles", connect.static("./app/styles")),
        connect.static(appConfig.app)
      ];
    }
  }
}
但是,如果我的URL中有“.”(句号),Grunt将无法重新加载页面。我在Angular应用程序中使用HTML5模式,效果很好

我能知道这是哪一部分吗

[
  require("connect-modrewrite")(["!(\\..+)$ / [L]"])
].concat(
  optBase.map(function (path) { return connect.static(path); })
)
是导致它失败的原因,我该如何修复它

注意:仅在重新加载页面时失败。我第一次访问路由时,它工作,然后如果我点击刷新,它就会失败