Last active
May 13, 2016 22:35
-
-
Save deepakazad/8ef0b18377c64b964d732ac35673ff2c to your computer and use it in GitHub Desktop.
Enable HTML5 mode in AngularJS - Grunt changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
]; | |
} | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install connect-modrewrite --save-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"devDependencies": { | |
"connect-modrewrite": "^0.9.0", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment