-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
49 lines (40 loc) · 1.22 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
47
48
49
/**
* Created by user on 19.01.2015.
*/
var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
minifyCSS = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat');
gulp.task('default', ['build-css', 'build-js'], function() {
/*gulp.watch('public/css*//*.css', function(event) {
gulp.run('build-css');
})*/
//gulp.watch('public/js/**/*.js', function(event) {
// gulp.run('build-js');
//})
});
gulp.task('build-css', function() {
//admin
gulp.src('public/admin/css/*.css')
.pipe(concatCss("styles/bundle.css"))
.pipe(minifyCSS())
.pipe(gulp.dest('public/build/admin/'));
//front
gulp.src('public/front/css/*.css')
.pipe(concatCss("styles/bundle.css"))
.pipe(minifyCSS())
.pipe(gulp.dest('public/build/front/'));
});
gulp.task('build-js', function() {
//admin
gulp.src('public/admin/js/**/*.js')
.pipe(concat('js/bundle.js'))
.pipe(uglify())
.pipe(gulp.dest('public/build/admin/'));
//front
gulp.src('public/front/js/**/*.js')
.pipe(concat('js/bundle.js'))
.pipe(uglify())
.pipe(gulp.dest('public/build/front/'));
});