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

Commit 152dfce

Browse files
committed
Fix tsc task
1 parent 0e9fb42 commit 152dfce

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

build/gulp/tasks/bundle.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ 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

29+
task('bundle:package:types:clean', () => del(`${paths.packageDist(packageName)}/dts`))
30+
2831
// ----------------------------------------
2932
// Build
3033
// ----------------------------------------
@@ -45,13 +48,22 @@ task('bundle:package:es', () =>
4548
.pipe(dest(paths.packageDist(packageName, 'es'))),
4649
)
4750

48-
task('bundle:package:types:tsc', () => sh(`cd packages/${packageName} && tsc -b`))
51+
task('bundle:package:types:tsc', () => {
52+
let cmd = 'tsc -b'
53+
if (process.cwd() === config.path_base) {
54+
cmd = `cd packages && cd ${packageName} && ${cmd}`
55+
}
56+
return sh(cmd)
57+
})
4958
task('bundle:package:types:copy', () => {
5059
return src(paths.packageDist(packageName, 'dts/src/**/*.d.ts')).pipe(
5160
dest(paths.packageDist(packageName, 'es')),
5261
)
5362
})
54-
task('bundle:package:types', series('bundle:package:types:tsc', 'bundle:package:types:copy'))
63+
task(
64+
'bundle:package:types',
65+
series('bundle:package:types:tsc', 'bundle:package:types:copy', 'bundle:package:types:clean'),
66+
)
5567

5668
task('bundle:package:umd', cb => {
5769
process.env.NODE_ENV = 'build'
@@ -92,7 +104,4 @@ task(
92104
)
93105
task('bundle:package', series('bundle:package:no-umd', 'bundle:package:umd'))
94106

95-
task('bundle:all-packages', async () => {
96-
await sh('lerna run build')
97-
del.sync(`${config.paths.packages()}/*/dist/dts`)
98-
})
107+
task('bundle:all-packages', () => sh('lerna run build'))

0 commit comments

Comments
 (0)