-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-web.js
More file actions
31 lines (27 loc) · 729 Bytes
/
build-web.js
File metadata and controls
31 lines (27 loc) · 729 Bytes
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
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const watch = process.argv.indexOf('--no-watch') < 0;
const config = require('./webpack.config.js');
// var electronCompiler = webpack(require('./electron/webpack.electron'));
const compiler = webpack(config);
const statOpts = {
hash: true,
timing: true,
assets: true,
chunks: false,
children: false,
version: false,
};
if (watch) {
compiler.watch({}, (err, stats) => {
console.log(stats.toString(statOpts));
});
} else {
// electronCompiler.run(function (err, stats) {
// console.log(stats.toString(statOpts));
// });
compiler.run((err, stats) => {
console.log(stats.toString(statOpts));
});
}