-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
110 lines (95 loc) · 2.62 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
var gulp = require('gulp');
var less = require('gulp-less');
var stylus = require('gulp-stylus');
var jade = require("gulp-jade");
var coffee = require('gulp-coffee');
var cjsx = require('gulp-cjsx');
var plumber = require('gulp-plumber');
var jade = require("gulp-jade")
var del = require('del');
var babel = require('gulp-babel');
var sass = require('gulp-sass');
var sym = require('gulp-sym');
var paths = {
coffee: ['./src/**/*.coffee'],
jade: ['./src/**/*.jade'],
less: ['./src/**/*.less'],
stylus: ['./src/**/*.styl'],
cjsx: ['./src/**/*.cjsx'],
es6: ['./src/**/*.js'],
sass: ['./src/**/*.scss'],
};
gulp.task('clean', function(){});
gulp.task('images', function() {
return gulp.src(
[ './src/renderer/images/**' ],
{ base: 'src' }
)
.pipe( gulp.dest( 'build' ) );
});
gulp.task('es6', ['clean'], function() {
return gulp.src(paths.es6)
.pipe(plumber())
.pipe(babel())
.pipe(gulp.dest('build'));
});
gulp.task('coffee', ['clean'], function() {
return gulp.src(paths.coffee)
.pipe(plumber())
.pipe(coffee())
.pipe(gulp.dest('build'));
});
gulp.task('main', ['clean'], function() {
return gulp.src('./main.coffee')
.pipe(plumber())
.pipe(coffee({bare: true}))
.pipe(gulp.dest('build'));
});
gulp.task('jade', ['clean'], function(){
return gulp.src(paths.jade)
.pipe(plumber())
.pipe(jade({
pretty: true
}))
.pipe(gulp.dest('build'));
});
gulp.task('less', ['clean'], function () {
return gulp.src(paths.less)
.pipe(plumber())
.pipe(less({
}))
.pipe(gulp.dest('build'));
});
gulp.task('stylus', ['clean'], function () {
return gulp.src(paths.stylus)
.pipe(plumber())
.pipe(stylus({
}))
.pipe(gulp.dest('build'));
});
gulp.task('cjsx', ['clean'], function() {
gulp.src(paths.cjsx)
.pipe(plumber())
.pipe(cjsx({ bare: true }))
.pipe(gulp.dest('build'));
});
gulp.task('sass', function () {
gulp.src(paths.sass)
.pipe(sass({ includePaths: ['node_modules'] }).on('error', sass.logError))
.pipe(gulp.dest('build'));
});
gulp.task('fonts', function () {
gulp.src('node_modules/font-awesome/fonts')
.pipe(sym('build/renderer/fonts', { force: true }));
});
gulp.task('watch', function() {
gulp.watch('./main.coffee', ['main']);
gulp.watch(paths.coffee, ['coffee']);
gulp.watch(paths.jade, ['jade']);
gulp.watch(paths.less, ['less']);
gulp.watch(paths.stylus, ['stylus']);
gulp.watch(paths.cjsx, ['cjsx']);
gulp.watch(paths.es6, ['es6']);
gulp.watch(paths.sass, ['sass']);
});
gulp.task('default', ['watch', 'coffee', 'jade', 'main', 'less', 'cjsx', 'stylus', 'es6', 'sass', 'fonts', 'images']);