mirror of
https://github.com/element-plus/element-plus.git
synced 2024-11-27 02:01:15 +08:00
fix(build): improve code style (#528)
This commit is contained in:
parent
4e8ea7e4c1
commit
39cf4fc8c1
@ -12,9 +12,12 @@ const pkgs = getPackagesSync()
|
||||
!name.includes('transition') &&
|
||||
!name.includes('utils'),
|
||||
)
|
||||
|
||||
const buildChild = (a, b) => {
|
||||
const c1 = cp.spawn('node', ['./build/build.component.js', a, b])
|
||||
const STEP = 4
|
||||
const START = 0
|
||||
const buildChild = (start, end) => {
|
||||
let s = start
|
||||
let e = end
|
||||
const c1 = cp.spawn('node', ['./build/build.component.js', s, e])
|
||||
c1.stdout.on('data', function (data) {
|
||||
spinner.info(`${chalk.blue(data)}`)
|
||||
})
|
||||
@ -24,17 +27,17 @@ const buildChild = (a, b) => {
|
||||
})
|
||||
|
||||
c1.on('close', function (code) {
|
||||
a += 5
|
||||
b += 5
|
||||
if (a > pkgs.length && b > pkgs.length) {
|
||||
s += STEP
|
||||
e += STEP
|
||||
if (s > pkgs.length) {
|
||||
spinner.succeed(`${chalk.green('Build done. Exit code ' + code)}`)
|
||||
return
|
||||
}
|
||||
buildChild(a, b)
|
||||
buildChild(s, e)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* @link https://github.com/ezolenko/rollup-plugin-typescript2/issues/177
|
||||
*/
|
||||
buildChild(0, 5)
|
||||
buildChild(START, STEP)
|
||||
|
@ -24,6 +24,7 @@ const runBuild = async () => {
|
||||
build(inputs[index])
|
||||
|
||||
async function build(name) {
|
||||
if (!name) return
|
||||
const inputOptions = {
|
||||
input: path.resolve(__dirname, `../packages/${name.split('@element-plus/')[1]}/index.ts`),
|
||||
plugins: [
|
||||
@ -68,8 +69,6 @@ const runBuild = async () => {
|
||||
index++
|
||||
if (index < inputs.length) {
|
||||
await build(inputs[index])
|
||||
} else {
|
||||
console.log('batch done')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user