Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Simple, gulp config.
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var postcss = require('gulp-postcss');
var autoprefixer = require('autoprefixer');
var cssnano = require('cssnano');
gulp.task('js', function() {
gulp.src('app/js/*.js')
.pipe(concat('script.js'))
.pipe(uglify())
.pipe(gulp.dest('build/js/'))
});
gulp.task('css', function() {
var preprocessors = [
autoprefixer({browsers: ['last 2 version']}),
cssnano(),
]
gulp.src('app/css/*.css')
.pipe(concat('main.css'))
.pipe(postcss(preprocessors))
.pipe(gulp.dest('build/css/'))
});
//gulp.watch('app/css/*.css', ['css']);
gulp.task('default', ['js', 'css'], function() {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment