Created
October 14, 2016 11:23
-
-
Save SurenderLohia/dc4270eeb2fa59b0ede69bb784dde26d to your computer and use it in GitHub Desktop.
Simple, gulp config.
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
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