Skip to content

Commit

Permalink
fix: remove --no-ts-defs before using babel (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosvega91 committed Dec 10, 2020
1 parent 4da07c4 commit 6b700e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/scripts/build/babel.js
Expand Up @@ -42,13 +42,18 @@ const copyFiles = args.includes('--no-copy-files') ? [] : ['--copy-files']
const useSpecifiedOutDir = args.includes('--out-dir')
const builtInOutDir = 'dist'
const outDir = useSpecifiedOutDir ? [] : ['--out-dir', builtInOutDir]
const noTypeDefinitions = args.includes('--no-ts-defs')

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

if (noTypeDefinitions) {
args = args.filter(a => a !== '--no-ts-defs')
}

function go() {
let result = spawn.sync(
resolveBin('@babel/cli', {executable: 'babel'}),
Expand All @@ -66,7 +71,7 @@ function go() {

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

if (hasTypescript && !args.includes('--no-ts-defs')) {
if (hasTypescript && !noTypeDefinitions) {
console.log('Generating TypeScript definitions')
result = generateTypeDefs(pathToOutDir)
console.log('TypeScript definitions generated')
Expand Down

0 comments on commit 6b700e6

Please sign in to comment.