-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
40 lines (34 loc) · 1.32 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
39
var gulp = require('gulp'),
less = require('gulp-less'),
mini = require('gulp-minify-css'),
name = require('gulp-rename'),
conc = require('gulp-concat'),
ugly = require('gulp-uglify');
gulp.task('less', function()
{
return gulp.src('./public/less/main.less')
.pipe(less({compress: true}))
.pipe(mini({keepBreaks: false, processImport: true}))
.pipe(name('main.min.css'))
.pipe(gulp.dest('./public/css'));
});
gulp.task('concatjs', function()
{
return gulp.src(['./public/components/mustache/mustache.js', './public/components/jquery/jquery.min.js', './public/components/moment/min/moment.min.js', './public/components/imagesloaded/imagesloaded.pkgd.min.js', './public/components/Chart.js/Chart.min.js', './public/components/bootstrap/dist/js/bootstrap.min.js', './public/components/datatables/media/js/jquery.datatables.min.js', './public/components/datatables/media/js/bootstrap.datatables.js', './public/components/summernote/dist/summernote.min.js', './public/js/libs/*.js', './public/js/raw/*.js'])
.pipe(conc('main.min.js'))
.pipe(ugly())
.pipe(gulp.dest('./public/js'));
});
gulp.task('default', function()
{
gulp.run('less');
gulp.run('concatjs');
gulp.watch('./public/less/*.less', function()
{
gulp.run('less');
});
gulp.watch('./public/js/raw/*.js', function()
{
gulp.run('concatjs');
});
});