Skip to content

Instantly share code, notes, and snippets.

@s3w47m88
Created August 30, 2018 22:50
Show Gist options
  • Save s3w47m88/e6ed1ec6838cdeeaa2ed97afbe11ea43 to your computer and use it in GitHub Desktop.
Save s3w47m88/e6ed1ec6838cdeeaa2ed97afbe11ea43 to your computer and use it in GitHub Desktop.
var gulp = require('gulp');
var pug = require('gulp-pug');
var less = require('gulp-less');
var minifyCSS = require('gulp-csso');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var gulp = require('gulp'),
watch = require('gulp-watch');
gulp.task('css', function(){
return gulp.src('css/*.less')
.pipe(less())
.pipe(minifyCSS())
.pipe(gulp.dest('build/css'))
});
gulp.task('js', function(){
return gulp.src('js/*.js')
.pipe(sourcemaps.init())
.pipe(concat('app.min.js'))
.pipe(sourcemaps.write())
.pipe(gulp.dest('build/js'))
});
gulp.task('watch', function () {
gulp.watch(['./js/*.js'], ['./css/*.less']);
});
gulp.task('default', [ 'css', 'js', 'watch' ]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment