-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (29 loc) · 888 Bytes
/
app.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
/**
* Created by army8735 on 2017/9/30.
*/
'use strict';
module.exports = app => {
app.beforeStart(function* () {
// app.logger.info('env: %s', app.config.env);
// app.logger.info('hotDeploy: %s', app.config.hotDeploy);
if(app.config.hotDeploy) {
// static的webpack
const webpack = require('webpack');
const webpackConfig = require('./webpack.config');
let compiler = webpack(webpackConfig);
compiler.watch({
ignored: /node_modules/,
}, function(err, status) {
// app.logger.info('webpack watch: %s', !!status);
});
// migi pre
const webpackConfig2 = require('./webpack.node');
let compiler2 = webpack(webpackConfig2);
compiler2.watch({
ignored: /node_modules/,
}, function(err, status) {
// app.logger.info('webpack watch: %s', !!status);
});
}
});
};