-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·54 lines (39 loc) · 1.1 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
var electron = require('electron-connect').server.create();
var gulp = require('gulp');
var concat = require('gulp-concat');
var webpack = require('webpack-stream');
gulp.task('webpack', function () {
gulp.src('./source/display/router/index.js')
.pipe(webpack({
output: {
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
test: /\.js$/,
loader: 'babel-loader?presets[]=es2015&presets[]=react'
}]
}
}))
.pipe(gulp.dest('./public/js'));
});
gulp.task('css', function() {
gulp.src([
'./node_modules/bootstrap/dist/css/bootstrap.css',
'./source/**/**/**/*.css'
])
.pipe(concat('bundle.css'))
.pipe(gulp.dest('./public/style'));
});
gulp.task('font', function() {
gulp.src([
'./node_modules/bootstrap/dist/fonts/*'
])
.pipe(gulp.dest('./public/fonts'));
});
gulp.task('default', ['css', 'font', 'webpack'], function () {
electron.start();
gulp.watch('./source/display/**/**/**/*.css', ['css']);
gulp.watch('./source/display/**/**/**/*.js', ['webpack']);
});