mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
22 lines
1.1 KiB
JavaScript
22 lines
1.1 KiB
JavaScript
|
"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];
|
||
|
},
|
||
|
};
|
||
|
};
|