Skip to content

Instantly share code, notes, and snippets.

@SurenderLohia
Created October 14, 2016 11:23
Show Gist options
  • Save SurenderLohia/dc4270eeb2fa59b0ede69bb784dde26d to your computer and use it in GitHub Desktop.
Save SurenderLohia/dc4270eeb2fa59b0ede69bb784dde26d to your computer and use it in GitHub Desktop.
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