Last active
August 29, 2015 14:13
-
-
Save djom202/8d2c81f3681a3d6d9803 to your computer and use it in GitHub Desktop.
Archivo de Configuracion de GulpServer actualizado
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
/* Variables */ | |
var gulp = require('gulp'), | |
jshint = require('gulp-jshint'), | |
uglify = require('gulp-uglify'), | |
rename = require('gulp-rename'), | |
concat = require('gulp-concat'), | |
notify = require('gulp-notify'), | |
livereload = require('gulp-livereload'), | |
del = require('del'), | |
connect = require('gulp-connect'), | |
jade = require('gulp-jade'), | |
less = require('gulp-less'), | |
historyApiFallback = require('connect-history-api-fallback'); | |
var paths = { | |
scripts: [ | |
'herlpers/*.js', | |
'herlpers/*.json', | |
'*/**/*.html', | |
'css/*.css', | |
'js/*.js' | |
] | |
}; | |
gulp.task('reload', function() { | |
return gulp.src(paths.scripts) | |
.pipe(connect.reload()); | |
}); | |
/* Init GulpServer */ | |
gulp.task('default', function() { | |
gulp.start('reload', 'watch', 'webserver'); | |
}); | |
/* Cambio de archivos */ | |
gulp.task('watch', function() { | |
gulp.watch(paths.scripts, ['reload']); | |
}); | |
/* LocalServer */ | |
gulp.task('webserver', function() { | |
connect.server({ | |
root: './', | |
hostname: '0.0.0.0', | |
port: 9000, | |
livereload: true, | |
middleware: function(connect, opt) { | |
return [ historyApiFallback ]; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment