Here's what the insert block in the Grunt file looks like:
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) ]; } } }
However, if my URL has a '.' (period) in it, Grunt does not reload the page. I use HTML5 mode in my Angular app and it works great.
Can i find out which part
require('connect-modrewrite')(['!(\\..+)$ / [L]'])].concat( optBase.map(function(path){ return connect.static(path); }))
causes an error and how to fix it?
Note. It does not work only when reloading the page. The first time I visit a route, it works, and then if I click update, it fails.
javascript gruntjs
Simran kaur
source share