Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit c10be51

Browse files
committed
Fix tsc task
1 parent 0e9fb42 commit c10be51

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

build/gulp/tasks/bundle.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ task('bundle:package:clean', () =>
2222
`${paths.packageDist(packageName)}/es/*`,
2323
`${paths.packageDist(packageName)}/commonjs/*`,
2424
`${paths.packageDist(packageName)}/umd/*`,
25+
`${paths.packageDist(packageName)}/dts`,
2526
]),
2627
)
2728

@@ -45,7 +46,13 @@ task('bundle:package:es', () =>
4546
.pipe(dest(paths.packageDist(packageName, 'es'))),
4647
)
4748

48-
task('bundle:package:types:tsc', () => sh(`cd packages/${packageName} && tsc -b`))
49+
task('bundle:package:types:tsc', () => {
50+
let cmd = 'tsc -b'
51+
if (process.cwd() === config.path_base) {
52+
cmd = `cd packages && cd ${packageName} && ${cmd}`
53+
}
54+
return sh(cmd)
55+
})
4956
task('bundle:package:types:copy', () => {
5057
return src(paths.packageDist(packageName, 'dts/src/**/*.d.ts')).pipe(
5158
dest(paths.packageDist(packageName, 'es')),
@@ -94,5 +101,5 @@ task('bundle:package', series('bundle:package:no-umd', 'bundle:package:umd'))
94101

95102
task('bundle:all-packages', async () => {
96103
await sh('lerna run build')
97-
del.sync(`${config.paths.packages()}/*/dist/dts`)
104+
return del(`${config.paths.packages()}/*/dist/dts`)
98105
})

0 commit comments

Comments
 (0)