Skip to content

Instantly share code, notes, and snippets.

@deepakazad
Last active May 13, 2016 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepakazad/8ef0b18377c64b964d732ac35673ff2c to your computer and use it in GitHub Desktop.
Save deepakazad/8ef0b18377c64b964d732ac35673ff2c to your computer and use it in GitHub Desktop.
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