nestjs-auto-reflect-metadata-emitter
Version:
[](https://github.com/Codibre/nestjs-auto-reflect-metadata-emitter/actions) [;
exports.TsConfigProvider = void 0;
const fs_1 = require("fs");
const path_1 = require("path");
class TsConfigProvider {
typescriptLoader;
constructor(typescriptLoader) {
this.typescriptLoader = typescriptLoader;
}
getByConfigFilename(configFilename) {
const configPath = (0, path_1.join)(process.cwd(), configFilename);
if (!(0, fs_1.existsSync)(configPath)) {
throw new Error('MISSING_TYPESCRIPT ${configFilename}');
}
const tsBinary = this.typescriptLoader.load();
const parsedCmd = tsBinary.getParsedCommandLineOfConfigFile(configPath, undefined, tsBinary.sys);
const { options, fileNames, projectReferences } = parsedCmd;
return { options, fileNames, projectReferences };
}
}
exports.TsConfigProvider = TsConfigProvider;
//# sourceMappingURL=tsconfig-provider.js.map