From 251ce2a2a757f648421922dbab558ba1f4952c3c Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Fri, 11 Sep 2020 09:30:44 +0900 Subject: [PATCH 1/2] Add fallback for tsconfig api - pick from #246 --- lib/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 95936cb2..2f511189 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -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) { From 6a48f7642802b54604ee8950765891fe425f504c Mon Sep 17 00:00:00 2001 From: Nogic <24802730+nogic1008@users.noreply.github.com> Date: Fri, 11 Sep 2020 09:44:50 +0900 Subject: [PATCH 2/2] fix: convert SourceMapGenerator to RawSourceMap - pick from #275 --- lib/process.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/process.js b/lib/process.js index f8b5ede8..5cc11de1 100644 --- a/lib/process.js +++ b/lib/process.js @@ -144,6 +144,6 @@ module.exports = function(src, filename, config) { return { code: output.code, - map + map: map && map.toJSON() } }