forked from xdan/jodit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.js
34 lines (30 loc) · 826 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
34
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2020 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
const webpack = require('webpack');
const yargs = require('yargs/yargs');
const { hideBin } = require('yargs/helpers');
const path = require('path');
const rootPath = path.resolve(process.cwd()) + path.sep;
const config = require(path.resolve(rootPath, './webpack.config.js'));
const argv = yargs(hideBin(process.argv)).option('uglify', { type: 'boolean' })
.argv;
const opt = config(
[],
{
mode: 'production',
uglify: true,
es: 'es5',
...argv
},
rootPath
);
webpack(opt, (err, stats) => {
if (err) {
console.log(err);
} else {
console.log(stats.toString({ colors: true }));
}
});