-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
46 lines (42 loc) · 1.14 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
40
41
42
43
44
45
46
/*Load all plugin define in package.json*/
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
plugins = gulpLoadPlugins(),
concat = require('gulp-concat-sourcemap');
/*JS task*/
gulp.task('dist', function () {
gulp.src([
'assets/js/src/main.js',
'assets/js/src/tools.js',
'assets/js/src/models/*.js',
'assets/js/src/views/*.js',
'assets/js/src/*.js',
'assets/js/src/init.js'
])
.pipe(plugins.uglify())
.pipe(concat('app.min.js', { sourceRoot : '../../' }))
.pipe(gulp.dest('assets/js/'));
gulp.src([
'assets/css/admin.css'
])
.pipe(plugins.cssmin())
.pipe(plugins.rename( { 'suffix' : '.min' } ))
.pipe(gulp.dest('assets/css/'));
});
gulp.task('dev', function () {
return gulp.src([
'assets/js/src/main.js',
'assets/js/src/tools.js',
'assets/js/src/models/*.js',
'assets/js/src/views/*.js',
'assets/js/src/*.js',
'assets/js/src/init.js'
])
.pipe(plugins.jshint())
.pipe(concat('app.js', { sourceRoot : '../../' }))
.pipe(gulp.dest('assets/js/'));
});
// On default task, just compile on demand
gulp.task('default', function() {
gulp.watch( 'assets/js/src/**/*.js', [ 'dev' ] );
});