Answer the question
In order to leave comments, you need to log in
What happened to Gulp?
Hello!
Help to understand the error in Gulp.js
Gulpfile.js
var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
minifyCSS = require('gulp-minify-css'),
prefix = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
imagemin = require('gulp-imagemin');
// css
gulp.task('css', function () {
gulp.src('css/*.css')
.pipe(concatCss('bundle.css'))
.pipe(prefix('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
.pipe(minifyCSS({noRebase:true}))
.pipe(rename('bundle.min.css'))
.pipe(gulp.dest('app/css'));
});
gulp.task('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('main.js'))
.pipe(gulp.dest('app/js'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('app/js'));
});
// Compress Task
gulp.task('compress', function() {
gulp.src('img/*')
.pipe(imagemin({
progressive: true
}))
.pipe(gulp.dest('app/img'));
});
gulp.task('default', ['css', 'scripts', 'compress']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question