Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Enable HTML5 mode in AngularJS - Grunt changes
var modRewrite = require('connect-modrewrite'); //Make sure to declare this at top of the file
.
.
.
livereload: {
options: {
open: true,
middleware: function(connect) {
return [
modRewrite(['^[^\\.]*$ /index.html [L]']), //New Line, keep rest of the middlewares as is
connect.static('.tmp'),
connect().use(
'/bower_components',
connect.static('./bower_components')
),
connect().use(
'/app/styles',
connect.static('./app/styles')
),
connect.static(appConfig.app)
];
}
}
},
npm install connect-modrewrite --save-dev
"devDependencies": {
"connect-modrewrite": "^0.9.0",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment