-
-
Save DavidPeralvarez/70af783a0fb3812fef36d8562baf64e7 to your computer and use it in GitHub Desktop.
Curso CSS Grid - Entorno de desarrollo
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
//1- Añadir vendor prefixes | |
//2- Concatenar hojas de estilo | |
//3- Ejecutar funciones al guardar | |
//4- Recargar automáticamente el navegador | |
var gulp = require('gulp'), | |
autoprefixer = require('gulp-autoprefixer'), | |
concatcss = require('gulp-concat-css'), | |
browsersync = require('browser-sync').create(); | |
function estilos(done){ | |
gulp.src('./src/*.css') | |
.pipe(autoprefixer({ | |
overrideBrowserslist: ['> 1%'], | |
flexbox : true, | |
grid : 'autoplace' | |
})) | |
.pipe(concatcss('style.css')) | |
.pipe(gulp.dest('./dist')); | |
done(); | |
} | |
// Recagargar el navegador | |
function recargar(done){ | |
browsersync.reload(); | |
done(); | |
} | |
// Servir el contenido | |
function servir(done){ | |
browsersync.init({ | |
server : { | |
baseDir : "./" | |
} | |
}); | |
done(); | |
} | |
// Observar | |
function observar(done){ | |
gulp.watch('./src/*.css',gulp.series(estilos,recargar)); | |
gulp.watch('./*.html', recargar); | |
done(); | |
} | |
gulp.task('default', gulp.series(estilos, servir, observar)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment