Skip to content

Instantly share code, notes, and snippets.

@dleitee
Last active September 21, 2015 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dleitee/3747a215fe3d347de826 to your computer and use it in GitHub Desktop.
Save dleitee/3747a215fe3d347de826 to your computer and use it in GitHub Desktop.
gulp with es6
import gulp from 'gulp';
import stylus from 'gulp-stylus';
import uglify from 'gulp-uglify';
import imagemin from 'gulp-imagemin';
gulp.task('css', () => {
return gulp.src('./src/css/*.styl')
.pipe(stylus({
compress: true
}))
.pipe(gulp.dest('./build/css'));
});
gulp.task('js', () => {
return gulp.src('./src/js/*.js')
.pipe(uglify())
.pipe(gulp.dest('./build/js'));
});
gulp.task('img', () => {
return gulp.src('./src/img/*')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
}))
.pipe(gulp.dest('./build/img'));
});
gulp.task('default', ['css', 'js', 'img'], () => {} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment