forked from wulkano/Kap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
53 lines (44 loc) · 1.73 KB
/
gulpfile.babel.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
import babel from 'gulp-babel';
import cssnano from 'cssnano';
import gulp from 'gulp';
import injectSvg from 'gulp-inject-svg';
import postcss from 'gulp-postcss';
import postcssExtend from 'postcss-extend';
import postcssNested from 'postcss-nested';
import postcsssSimpleVars from 'postcss-simple-vars';
import pug from 'gulp-pug';
gulp.task('build:js:main', () =>
gulp.src('app/src/main/*.js')
.pipe(babel())
.pipe(gulp.dest('app/dist/main')));
gulp.task('build:pug', () =>
gulp.src('app/src/renderer/pug/*')
.pipe(pug())
.pipe(injectSvg())
.pipe(gulp.dest('app/dist/renderer/html')));
gulp.task('build:css', () =>
gulp.src('app/src/renderer/css/*')
.pipe(postcss([postcsssSimpleVars, postcssExtend, postcssNested, cssnano]))
.pipe(gulp.dest('app/dist/renderer/css')));
gulp.task('build:js:renderer', () =>
gulp.src('app/src/renderer/js/*.js')
.pipe(babel())
.pipe(gulp.dest('app/dist/renderer/js')));
gulp.task('build:scripts', () =>
gulp.src('app/src/scripts/*.js')
.pipe(babel())
.pipe(gulp.dest('app/dist/scripts')));
gulp.task('build:js:common', () =>
gulp.src('app/src/common/*.js')
.pipe(babel())
.pipe(gulp.dest('app/dist/common')));
gulp.task('build', ['build:js:main', 'build:pug', 'build:css', 'build:js:renderer', 'build:scripts', 'build:js:common']);
gulp.task('default', ['build']);
gulp.task('watch', ['build'], () => {
gulp.watch('app/src/main/*.js', ['build:js:main']);
gulp.watch('app/src/renderer/pug/*.pug', ['build:pug']);
gulp.watch('app/src/renderer/css/*.css', ['build:css']);
gulp.watch('app/src/renderer/js/*.js', ['build:js:renderer']);
gulp.watch('app/src/scripts/*.js', ['build:scripts']);
gulp.watch('app/src/common/*.js', ['build:js:common']);
});