Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
fix: don't throw if request is a core node module
Browse files Browse the repository at this point in the history
  • Loading branch information
kengoldfarb committed Jun 1, 2020
1 parent ab6a73f commit 07e378c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/PathResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ export default class PathResolver {
return this.pathCache[request]
}

// Check if it's a core node module
// Is it a core node module?
const coreModule = coreModuleLoader.builtinModules.find(m => m === request)
if (coreModule) {
return request
}

let foundMatch = false
const attemptedPaths: string[] = []
const pathPatterns = Object.keys(this.replacePaths)
Expand Down

0 comments on commit 07e378c

Please sign in to comment.