Last active
May 28, 2018 07:13
-
-
Save anthonyboutinov/d0dd4c6b4cf9e9092b249bc7c69721cf to your computer and use it in GitHub Desktop.
Yeoman Angular HTML5 Mode
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
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} -s [OR] | |
RewriteCond %{REQUEST_FILENAME} -l [OR] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^.*$ - [NC,L] | |
RewriteRule ^(.*) /app/index.html [NC,L] |
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
// You can place this outside your module.exports function. | |
var modRewrite = require('connect-modrewrite'); | |
//. . . | |
livereload: { | |
options: { | |
open: true, | |
middleware: function (connect) { | |
return [ | |
modRewrite([ | |
'!\\.html|\\.js|\\.css|\\.svg|\\.json|\\.jpg|\\.jpeg|\\.xls|\\.xlsx|\\.doc|\\.docx|\\.ppt|\\.pptx|\\.txt|\\.rtf|\\.zip|\\.rar|\\.gif|\\.png$ /index.html [L]' | |
]), | |
//. . . |
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
<head> | |
// . . . | |
<base href="/"> | |
// Add slash before 'styles' in build comments and in hrefs in links | |
<!-- build:css(.) /styles/vendor.css --> | |
. . . | |
<!-- build:css(.tmp) /styles/main.css --> | |
<link rel="stylesheet" href="/styles/main.css"> | |
. . . | |
<!-- endbuild --> | |
//... |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment