-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
38 lines (27 loc) · 894 Bytes
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var gulp = require('gulp');
var less = require('gulp-less');
var minifyCss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
var BASE_DIR = './';
gulp.task('scripts', function(){
console.log('Scripts!');
gulp.src(BASE_DIR + 'src/**/*.js')
.pipe(uglify())
.pipe(gulp.dest(BASE_DIR + 'dist/'));
});
gulp.task('styles', function(){
console.log('Styles!');
gulp.src(BASE_DIR + 'src/**/*.less')
.pipe(less().on('error', function(e){
console.log(e.message);
}))
.pipe(minifyCss())
.pipe(gulp.dest(BASE_DIR + 'dist/'));
});
gulp.task('default', ['scripts', 'styles'],function(){
console.log('Watching JS!');
gulp.watch(BASE_DIR + 'src/**/*.js', ['scripts']);
console.log('Watching LESS!');
gulp.watch(BASE_DIR + 'src/**/*.less', ['styles']);
});