-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
71 lines (61 loc) · 1.71 KB
/
Copy pathgulpfile.js
File metadata and controls
71 lines (61 loc) · 1.71 KB
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
'use strict';
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var less = require('gulp-less');
var rename = require('gulp-rename');
var jeditor = require('gulp-json-editor');
var shell = require('gulp-shell');
var gulpJasmine = require('gulp-jasmine');
var minifyCSS = require('gulp-minify-css');
gulp.task('default', ['watch']);
gulp.task('watch', function () {
gulp.watch('public/css/**', ['compile-less']);
});
gulp.task('build', ['compile-less', 'bundle-js', 'type-production']);
gulp.task('unbuild', ['type-development']);
gulp.task('client-tests', function() {
return gulp.src('tests/**')
.pipe(gulpJasmine({
verbose: true
}));
});
gulp.task('jshint', function() {
return gulp.src([
'public/js/**/*js',
'tests/**/*js'
])
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('compile-less', function () {
return gulp.src('public/css/imports.less')
.pipe(less({
paths: ['public/css/']
}))
.pipe(rename('combined.css'))
.pipe(gulp.dest('public/build/'))
.pipe(minifyCSS())
.pipe(rename('combined.min.css'))
.pipe(gulp.dest('public/build/'));
});
gulp.task('type-production', function () {
return gulp.src('configs/app.json')
.pipe(jeditor({
type: 'production'
}, {
'indent_size': 2
}))
.pipe(gulp.dest('configs/'));
});
gulp.task('type-development', function () {
return gulp.src('configs/app.json')
.pipe(jeditor({
type: 'development'
}, {
'indent_size': 2
}))
.pipe(gulp.dest('configs/'));
});
gulp.task('bundle-js', shell.task([
'node public/bower_components/rjs/dist/r.js -o public/build/build.json > public/build/build.js.log'
]));