Skip to content

Commit

Permalink
Add fallback for tsconfig api
Browse files Browse the repository at this point in the history
- pick from vuejs#246
  • Loading branch information
nogic1008 committed Sep 11, 2020
1 parent 98c5d81 commit 251ce2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/utils.js
Expand Up @@ -66,9 +66,10 @@ const getBabelOptions = function loadBabelOptions(filename, options = {}) {
const getTsJestConfig = function getTsJestConfig(config) {
const createTransformer = require('ts-jest').createTransformer
const tr = createTransformer()
const { typescript } = tr.configsFor(config)
const configSet = tr.configsFor(config)
const tsConfig = configSet.typescript || configSet.parsedTsConfig
// Force es5 to prevent const vue_1 = require('vue') from conflicting
return { compilerOptions: { ...typescript.options, target: 'es5' } }
return { compilerOptions: { ...tsConfig.options, target: 'es5' } }
}

function isValidTransformer(transformer) {
Expand Down

0 comments on commit 251ce2a

Please sign in to comment.