Skip to content

Commit 6b700e6

Browse files
authored
fix: remove --no-ts-defs before using babel (#184)
1 parent 4da07c4 commit 6b700e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/scripts/build/babel.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ const copyFiles = args.includes('--no-copy-files') ? [] : ['--copy-files']
4242
const useSpecifiedOutDir = args.includes('--out-dir')
4343
const builtInOutDir = 'dist'
4444
const outDir = useSpecifiedOutDir ? [] : ['--out-dir', builtInOutDir]
45+
const noTypeDefinitions = args.includes('--no-ts-defs')
4546

4647
if (!useSpecifiedOutDir && !args.includes('--no-clean')) {
4748
rimraf.sync(fromRoot('dist'))
4849
} else {
4950
args = args.filter(a => a !== '--no-clean')
5051
}
5152

53+
if (noTypeDefinitions) {
54+
args = args.filter(a => a !== '--no-ts-defs')
55+
}
56+
5257
function go() {
5358
let result = spawn.sync(
5459
resolveBin('@babel/cli', {executable: 'babel'}),
@@ -66,7 +71,7 @@ function go() {
6671

6772
const pathToOutDir = fromRoot(parsedArgs.outDir || builtInOutDir)
6873

69-
if (hasTypescript && !args.includes('--no-ts-defs')) {
74+
if (hasTypescript && !noTypeDefinitions) {
7075
console.log('Generating TypeScript definitions')
7176
result = generateTypeDefs(pathToOutDir)
7277
console.log('TypeScript definitions generated')

0 commit comments

Comments
 (0)