mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
32 lines
679 B
JavaScript
32 lines
679 B
JavaScript
import { rolldown } from 'rolldown'
|
|
import { parseArgs } from 'node:util'
|
|
import { readFile } from 'node:fs/promises'
|
|
import path from 'node:path'
|
|
|
|
const { positionals: targets } = parseArgs({
|
|
allowPositionals: true
|
|
})
|
|
|
|
|
|
|
|
|
|
for (const target of targets) {
|
|
const packageJSON = JSON.parse(await readFile(path.resolve(`packages/${target}/package.json`), 'utf8'))
|
|
console.log(packageJSON)
|
|
const bundle = await rolldown({
|
|
input: `packages/${target}/index.ts`,
|
|
})
|
|
|
|
await bundle.generate({
|
|
format: 'cjs',
|
|
})
|
|
|
|
await bundle.write({
|
|
file: `packages/${target}/dist/bundle.js`
|
|
})
|
|
}
|
|
|
|
|
|
console.log(performance.measure('build time'))
|
|
|