forked from youzan/vant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-lib.js
More file actions
34 lines (28 loc) · 790 Bytes
/
build-lib.js
File metadata and controls
34 lines (28 loc) · 790 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
32
33
34
/**
* Build npm lib
*/
const shell = require('shelljs');
const signale = require('signale');
const { Signale } = signale;
const tasks = [
'npm run bootstrap',
'npm run lint',
'npm run build:entry',
'node build/build-components.js',
'node build/build-style.js',
'node build/build-style-entry.js',
'cross-env NODE_ENV=production webpack --color --config build/webpack.pkg.js',
'cross-env NODE_ENV=production webpack -p --color --config build/webpack.pkg.js'
];
tasks.every(task => {
signale.start(task);
const interactive = new Signale({ interactive: true });
interactive.pending(task);
const result = shell.exec(`${task} --silent`);
if (result.code !== 0) {
interactive.error(task);
return false;
}
interactive.success(task);
return true;
});