Last active
December 18, 2015 03:49
-
-
Save distinctgrey/5720964 to your computer and use it in GitHub Desktop.
Enable pushState support for aYeoman generated SPA.
Source: https://github.com/platanus-repos/blog/blob/master/jekyll/_posts/2013-04-01-using-grunt-and-angular-with-pushstate-support.md
This file contains hidden or 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 hidden or 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'); | |
[...] | |
connect: { | |
options: { | |
port: 9000, | |
// change this to '0.0.0.0' to access the server from outside | |
hostname: 'localhost' | |
}, | |
livereload: { | |
options: { | |
middleware: function (connect) { | |
return [ | |
modRewrite([ | |
'!\\.?(js|css|html|hbs|eot|svg|ttf|woff|otf|css|png|jpg|git|ico) / [L]' | |
]), | |
lrSnippet, | |
mountFolder(connect, '.tmp'), | |
mountFolder(connect, 'app') | |
]; | |
} | |
} | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment