build: adjust esm formats
This commit is contained in:
@@ -27,7 +27,8 @@ 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.t || args.types
|
||||
const isRelease = args.release
|
||||
const buildTypes = args.t || args.types || isRelease
|
||||
const buildAllMatching = args.all || args.a
|
||||
const lean = args.lean || args.l
|
||||
const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
|
||||
@@ -54,6 +55,11 @@ async function build(target) {
|
||||
const pkgDir = path.resolve(`packages/${target}`)
|
||||
const pkg = require(`${pkgDir}/package.json`)
|
||||
|
||||
// only build published packages for release
|
||||
if (isRelease && pkg.private) {
|
||||
return
|
||||
}
|
||||
|
||||
// if building a specific format, do not remove dist.
|
||||
if (!formats) {
|
||||
await fs.remove(`${pkgDir}/dist`)
|
||||
|
||||
@@ -79,7 +79,7 @@ async function main() {
|
||||
|
||||
// build all packages with types
|
||||
if (!skipBuild) {
|
||||
await run('yarn', ['build', '-t'])
|
||||
await run('yarn', ['build', '--release'])
|
||||
// test generated dts files
|
||||
await run(bin('tsd'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user