"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const typescript_1 = require("typescript");
const diagnosticToString_1 = require("./diagnosticToString");
function transpileFile(contents, options, basePath) {
    const { outputText, diagnostics, sourceMapText = '' } = typescript_1.transpileModule(contents, {
        compilerOptions: Object.assign({}, options, { sourceMap: true }),
    });
    if (diagnostics && diagnostics.length > 0) {
        throw new Error(diagnosticToString_1.diagnosticsToString(diagnostics, basePath));
    }
    return {
        content: outputText,
        sourceMap: sourceMapText,
    };
}
exports.transpileFile = transpileFile;
//# sourceMappingURL=transpileFile.js.map