Skip to content

Commit

Permalink
Stop to process if no match
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoVictor committed Oct 12, 2022
1 parent a91324a commit 606d7fc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tsc-paths-replacer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ function getModuleRelativePath(

function getModulePath(moduleName: string, file: string): string | null {
const result = moduleName.match(config.prefixes);
if (result) {
const [alias] = result;
const relativePath = moduleName.substring(alias.length);
if (!result) {
return null;
}


for (const aliasPath of aliasesMap.get(alias)) {
const moduleSourcePath = path.resolve(aliasPath, relativePath);
Expand Down

0 comments on commit 606d7fc

Please sign in to comment.