"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var path_1 = require("path"); exports.compileUsingTranspileModule = function (configs, logger) { logger.debug('compileUsingTranspileModule(): create typescript compiler'); return { compileFn: function (code, fileName) { logger.debug({ fileName: fileName }, 'getOutput(): compiling as isolated module'); var normalizedFileName = path_1.normalize(fileName), result = configs.compilerModule.transpileModule(code, { fileName: normalizedFileName, transformers: configs.tsCustomTransformers, compilerOptions: configs.typescript.options, reportDiagnostics: configs.shouldReportDiagnostic(normalizedFileName), }); if (result.diagnostics && configs.shouldReportDiagnostic(normalizedFileName)) { configs.raiseDiagnostics(result.diagnostics, normalizedFileName, logger); } return [result.outputText, result.sourceMapText]; }, }; };