-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
78 lines (62 loc) · 2.03 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var babel = require('gulp-babel');
var react = require('gulp-react');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
//client
gulp.task('less', function () {
return gulp.src('./src/client/less/*.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
//.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest('./lib/public/css'));
});
gulp.task('react', function() {
gulp.src('./src/client/js/**/*.jsx')
.pipe(babel())
.pipe(react())
.pipe(uglify())
.pipe(gulp.dest('./lib/public/js'));
});
gulp.task('js', function() {
gulp.src('./src/client/js/*.js')
.pipe(babel())
.pipe(uglify())
.pipe(gulp.dest('./lib/public/js'));
});
gulp.task('img', function() {
gulp.src('./src/client/img/**/*.*')
.pipe(gulp.dest('./lib/public/img'));
});
gulp.task('html', function() {
gulp.src('./src/client/**/*.html')
.pipe(gulp.dest('./lib/public'));
});
gulp.task('font-awesome-font', function() {
gulp.src('./src/client/font-awesome/fonts/*')
.pipe(gulp.dest('./lib/public/font-awesome/fonts'));
});
gulp.task('font-awesome-less', function() {
return gulp.src('./src/client/font-awesome/less/font-awesome.less')
.pipe(less({
paths: [ path.join(__dirname, 'less', 'includes') ]
}))
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(gulp.dest('./lib/public/font-awesome/css'));
});
gulp.task('font-awesome', ['font-awesome-font', 'font-awesome-less']);
gulp.task('client', ['less', 'html', 'js', 'img', 'font-awesome', 'react']);
//server
gulp.task('copyJS', function() {
gulp.src('./src/server/**/*.js')
.pipe(gulp.dest('./lib'));
});
gulp.task('json', function() {
gulp.src('./src/server/**/*.json')
.pipe(gulp.dest('./lib'));
});
gulp.task('server', ['copyJS', 'json']);
gulp.task('default', ['client', 'server']);