Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tsLoaderConfigModule.getConfigFile = function getConfigFile(
compiler, loader, loaderOptions, compilerCompatible, log, compilerDetailsLogMessage) {
let configFilePath = loaderOptions.configFileName;
var configFileError;
log.logInfo(('ts-loader: Using config file at ' + configFilePath).green);
let configFile = compiler.readConfigFile(configFilePath, compiler.sys.readFile);
if (configFile.error) {
configFileError = tsLoaderUtilsModule.formatErrors(
[configFile.error], loaderOptions, compiler, {file: configFilePath})[0];
}
if (!configFileError) {
configFile.config.compilerOptions =
Object.assign({}, configFile.config.compilerOptions, loaderOptions.compilerOptions);
// do any necessary config massaging
if (loaderOptions.transpileOnly) {
configFile.config.compilerOptions.isolatedModules = true;
}
}
return {configFilePath: configFilePath, configFile: configFile, configFileError: configFileError};
};