Created
June 29, 2016 17:26
-
-
Save baltazarparra/c4ee3c808317941d5cc9a0309aa6d2f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); | |
var precss = require('precss'); | |
var cssnext = require('postcss-cssnext'); | |
var cssnano = require('cssnano'); | |
var uglify = require('gulp-uglify'); | |
var browserSync = require('browser-sync'); | |
var reload = browserSync.reload; | |
gulp.task('sync', function() { | |
var files = [ | |
'index.php', | |
'estilos.css' | |
]; | |
browserSync.init(files, { | |
proxy: 'http://localhost/base/', | |
notify: false | |
}); | |
}); | |
gulp.task('css', function () { | |
var processors = [ | |
precss, | |
cssnext, | |
cssnano | |
]; | |
return gulp.src('styles/estilos.css') | |
.pipe(postcss(processors)) | |
.pipe(gulp.dest('./')); | |
}); | |
gulp.task('js', function() { | |
return gulp.src('scripts/*.js') | |
.pipe(uglify()) | |
.pipe(gulp.dest('./')); | |
}); | |
gulp.task('default', [ 'sync' ], function() { | |
gulp.watch('styles/**/*.css', ['css']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment