Skip to content

Instantly share code, notes, and snippets.

@djom202
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djom202/8d2c81f3681a3d6d9803 to your computer and use it in GitHub Desktop.
Save djom202/8d2c81f3681a3d6d9803 to your computer and use it in GitHub Desktop.
Archivo de Configuracion de GulpServer actualizado
/* 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