-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.coffee
32 lines (23 loc) · 956 Bytes
/
gulpfile.coffee
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
gulp = require 'gulp'
webpack = require 'webpack'
webpackConfig = require './webpack.config.js'
debug = require('debug') 'gulp'
gutil = require 'gulp-util'
useref = require 'gulp-useref'
electron = require('electron-connect').server.create()
devCompiler = webpack webpackConfig
gulp.task 'webpack:build', (callback) ->
devCompiler.run (err, status) ->
#TODO deal with err and status
throw new gutil.PluginError('webpack:build', err) if err?
gutil.log '[webpack:build]', status.toString({colors: true});
console.log "finish build"
callback()
gulp.task 'watch', ['webpack:build'], =>
# Start browser process
electron.start()
# Restart browser process
gulp.watch ['main_process/*.coffee', 'index.js'], electron.restart
gulp.watch ['render/src/**/*.{css,js,vue}'], ['webpack:build']
gulp.watch ['render/dist/*.js', 'render/index.html'], electron.reload
gulp.task 'default', ['watch']