Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Dec 24, 2024
1 parent ba55ed3 commit f79b932
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ export function importResolve(filepath: string, options?: ImportResolveOptions)
// resolve will return file:// URL on Linux and MacOS expect on Windows
moduleFilePath = fileURLToPath(moduleFilePath);
}
if (!fs.existsSync(moduleFilePath)) {
throw new TypeError(`Cannot resolve module ${filepath} to ${moduleFilePath}, because ${moduleFilePath} does not exists`);
}

Check warning on line 183 in src/import.ts

View check run for this annotation

Codecov / codecov/patch

src/import.ts#L182-L183

Added lines #L182 - L183 were not covered by tests
} else {
moduleFilePath = getRequire().resolve(filepath);
}
Expand Down

0 comments on commit f79b932

Please sign in to comment.