Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Defer resolving url until loader call.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Nov 14, 2017
1 parent bdb3c8d commit e393fff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/module/esm/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ function load(id, parent, isMain, preload) {
const pkgInfo = PkgInfo.get(dirname(filePath))
const queryHash = getQueryHash(id)
const cacheId = filePath + queryHash
const options = pkgInfo ? pkgInfo.options : null
const url = getURLFromFilePath(filePath) + queryHash

let state = __non_webpack_require__

if (! (options && options.cjs.cache)) {
if (! (pkgInfo && pkgInfo.options.cjs.cache)) {
isMain = false

if (_extname(filePath) === ".mjs") {
Expand All @@ -57,6 +55,7 @@ function load(id, parent, isMain, preload) {
try {
child = _load(cacheId, parent, isMain, state, function () {
called = true
const url = getURLFromFilePath(filePath) + queryHash
return loader.call(this, filePath, url, parent, preload)
})

Expand Down

0 comments on commit e393fff

Please sign in to comment.