-
Notifications
You must be signed in to change notification settings - Fork 7
/
gulpfile.js
46 lines (41 loc) · 1.16 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
var gulp = require('gulp'),
minify = require('gulp-minify-css'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename');
var paths = {
dev: {
css: 'assets/components/modxtalks/css/web/',
js: 'assets/components/modxtalks/js/web/'
},
prod: {
css: 'assets/components/modxtalks/css/web/',
js: 'assets/components/modxtalks/js/web/'
}
};
// CSS
gulp.task('css', function () {
return gulp.src([
paths.dev.css + 'bbcode/bbcode.css',
paths.dev.css + '*.css'
])
.pipe(concat('styles.min.css'))
.pipe(gulp.dest(paths.prod.css))
.pipe(minify({keepSpecialComments: 0}))
.pipe(gulp.dest(paths.prod.css));
});
// JS
gulp.task('js', function () {
return gulp.src([
paths.dev.js + 'bbcode/bbcode.js',
paths.dev.js + '*.js'
])
.pipe(concat('scripts.min.js'))
.pipe(uglify())
.pipe(gulp.dest(paths.prod.js));
});
gulp.task('watch', function () {
gulp.watch(paths.dev.css + '/*.css', ['css']);
gulp.watch(paths.dev.js + '/*.js', ['js']);
});
gulp.task('default', ['css', 'js', 'watch']);