-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (34 loc) · 1.18 KB
/
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 inject = require('gulp-inject');
var angularFilesort = require('gulp-angular-filesort');
var less = require('gulp-less');
var concat = require('gulp-concat');
var gsi = require('gulp-scripts-index');
var watch = require('gulp-watch');
var debug = require('gulp-debug');
var babel = require('gulp-babel');
var uglify = require('gulp-uglify');
gulp.task('default', ['compile-scripts', 'compile-less', 'watch-less', 'watch-scripts']);
gulp.task('compile-less', function() {
return gulp
.src('./public/app/components/**/*.less')
.pipe(less())
.pipe(concat("dist.css"))
.pipe(gulp.dest('public/build/'))
});
gulp.task('watch-less', function() {
return gulp.watch('./public/app/components/**/*.less', ['compile-less']);
});
gulp.task('watch-scripts', function() {
return gulp.watch('./public/app/components/**/*.js', ['compile-scripts']);
});
gulp.task('compile-scripts', function() {
return gulp
.src('./public/app/components/**/*.js')
.pipe(babel({
presets: ['es2015']
}))
.pipe(angularFilesort())
.pipe(concat("scripts.js"))
.pipe(gulp.dest('./public/build'));
});