Created
March 27, 2015 10:26
-
-
Save tcarlsen/ec8512c7d6cf1f1e4c90 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
var gulp = require('gulp'); | |
var connect = require('gulp-connect'); | |
var modRewrite = require('connect-modrewrite'); | |
// Rewriting rule for clean urls | |
var middleware = [ | |
modRewrite([ | |
'!\\.\\w+$ /index.html [L]', | |
'^/bower_components/(.*) /$1' | |
]) | |
]; | |
gulp.task('serve', ['watch'], function () { | |
connect.server({ | |
root: ['src', '.tmp', 'src/assets', 'bower_components'], | |
port: 8000, | |
livereload: true, | |
middleware: function () { | |
return middleware; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment