|
|
@@ -34,6 +34,7 @@ const targets = args._
|
|
|
const formats = args.formats || args.f
|
|
|
const devOnly = args.devOnly || args.d
|
|
|
const prodOnly = !devOnly && (args.prodOnly || args.p)
|
|
|
+const buildTypes = args.withTypes || args.t
|
|
|
const sourceMap = args.sourcemap || args.s
|
|
|
const isRelease = args.release
|
|
|
const buildAllMatching = args.all || args.a
|
|
|
@@ -44,12 +45,25 @@ run()
|
|
|
async function run() {
|
|
|
const removeCache = scanEnums()
|
|
|
try {
|
|
|
- if (!targets.length) {
|
|
|
- await buildAll(allTargets)
|
|
|
- checkAllSizes(allTargets)
|
|
|
- } else {
|
|
|
- await buildAll(fuzzyMatchTarget(targets, buildAllMatching))
|
|
|
- checkAllSizes(fuzzyMatchTarget(targets, buildAllMatching))
|
|
|
+ const resolvedTargets = targets.length
|
|
|
+ ? fuzzyMatchTarget(targets, buildAllMatching)
|
|
|
+ : allTargets
|
|
|
+ await buildAll(resolvedTargets)
|
|
|
+ checkAllSizes(resolvedTargets)
|
|
|
+ if (buildTypes) {
|
|
|
+ await execa(
|
|
|
+ 'pnpm',
|
|
|
+ [
|
|
|
+ 'run',
|
|
|
+ 'build-dts',
|
|
|
+ ...(targets.length
|
|
|
+ ? ['--environment', `TARGETS:${resolvedTargets.join(',')}`]
|
|
|
+ : [])
|
|
|
+ ],
|
|
|
+ {
|
|
|
+ stdio: 'inherit'
|
|
|
+ }
|
|
|
+ )
|
|
|
}
|
|
|
} finally {
|
|
|
removeCache()
|