Skip to content

Commit

Permalink
Check FLAGS.esModuleSpecifierResolution in src/module/esm/resolve-fil…
Browse files Browse the repository at this point in the history
…ename.
  • Loading branch information
jdalton committed Mar 14, 2019
1 parent 86de88f commit 76b55af
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/module/esm/resolve-filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const {

const {
ELECTRON,
FLAGS,
YARN_PNP
} = ENV

Expand Down Expand Up @@ -147,14 +148,18 @@ function resolveFilename(request, parent, isMain = false, options) {
let pathname = request.replace(queryHashRegExp, "")

if (! hasEncodedSep(pathname)) {
const exts = cjsPaths
? void 0
: strictExts

const paths = isAbs
? [""]
: [fromPath]

let exts

if (! cjsPaths) {
exts = FLAGS.esModuleSpecifierResolution === "explicit"
? emptyArray
: strictExts
}

pathname = decodeURIComponent(pathname)
foundPath = findPath(pathname, paths, isMain, fields, exts)
}
Expand Down

0 comments on commit 76b55af

Please sign in to comment.