forked from tomcl/issie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
33 lines (28 loc) · 851 Bytes
/
build.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
const webpack = require('webpack');
const configMain = require('../webpack.config.main');
const configRenderer = require('../webpack.config.renderer');
const path = require('path');
const del = require('del');
const compilerMain = webpack(configMain);
const compilerRenderer = webpack(configRenderer);
(async () => {
/**
* Delete build and dist dirs
*/
await del([path.join(__dirname, '../build'), path.join(__dirname, '../dist')], { force: true });
/**
* Build main
*/
compilerMain.run((err, stats) => {
console.log('> Building main');
});
/**
* Build main
*/
const buildRenderer = (stats) => {
console.log('> Building renderer');
compilerRenderer.run((err, stats) => {});
return;
}
compilerMain.hooks.afterDone.tap('on-main-built', buildRenderer);
})();