chore: 使 js 編譯組件綫性工作, 並改爲 async 方法
This commit is contained in:
@@ -24,13 +24,14 @@ async function compileJs(path: string) {
|
|||||||
console.log(`编译: ${path}`)
|
console.log(`编译: ${path}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function(source: string, output: string) {
|
export default async function(source: string, output: string) {
|
||||||
|
const t = Date.now()
|
||||||
io.copyDir(source, output)
|
io.copyDir(source, output)
|
||||||
io.listFiles(output, {
|
for (const v of io.listFiles(output, {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
fullPath: true,
|
fullPath: true,
|
||||||
}).forEach(function (v) {
|
}))
|
||||||
if (/\.(t|j)sx?$/.test(v))
|
if (/\.(t|j)sx?$/.test(v))
|
||||||
compileJs(v)
|
await compileJs(v)
|
||||||
})
|
return (Date.now() - t) / 1000
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user