diff --git a/examples/typescript/preprocessor.js b/examples/typescript/preprocessor.js index 0a91f452b922..c884b4d4ae7a 100644 --- a/examples/typescript/preprocessor.js +++ b/examples/typescript/preprocessor.js @@ -6,7 +6,14 @@ const tsConfig = require('./tsconfig.json'); module.exports = { process(src, path) { if (path.endsWith('.ts') || path.endsWith('.tsx')) { - return tsc.transpile(src, tsConfig.compilerOptions, path, []); + const {outputText, sourceMapText} = tsc.transpileModule(src, { + compilerOptions: tsConfig.compilerOptions, + fileName: path, + reportDiagnostics: false, + }); + // Transformers can return a string with the transformed source text + // or a {code, map} if source maps are available + return {code: outputText, map: sourceMapText} } return src; },