Skip to content

Instantly share code, notes, and snippets.

@anthonyboutinov
Last active May 28, 2018 07:13
Show Gist options
  • Save anthonyboutinov/d0dd4c6b4cf9e9092b249bc7c69721cf to your computer and use it in GitHub Desktop.
Save anthonyboutinov/d0dd4c6b4cf9e9092b249bc7c69721cf to your computer and use it in GitHub Desktop.
Yeoman Angular HTML5 Mode
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]
// 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]'
]),
//. . .
<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 -->
//...
npm install connect-modrewrite --save-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment