Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const loadFrom = options.configFile || context;
const loadResult = TsconfigPaths.loadConfig(loadFrom);
if (loadResult.resultType === "failed") {
this.log.logError(`Failed to load ${loadFrom}: ${loadResult.message}`);
} else {
this.log.logInfo(
`tsconfig-paths-webpack-plugin: Using config file at ${
loadResult.configFileAbsolutePath
}`
);
this.baseUrl = options.baseUrl || loadResult.baseUrl;
this.absoluteBaseUrl = options.baseUrl
? path.resolve(options.baseUrl)
: loadResult.absoluteBaseUrl;
this.matchPath = TsconfigPaths.createMatchPathAsync(
this.absoluteBaseUrl,
loadResult.paths,
options.mainFields
);
}
}