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

Commit

Permalink
fix already-cached cjs transform handling
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Apr 30, 2018
1 parent f0764df commit 95b5f70
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,15 @@ export default function commonjs ( options = {} ) {
}
function setIsCjsPromise ( id, promise ) {
const isCjsPromise = isCjsPromises[id];
if (isCjsPromise)
isCjsPromise.resolve(promise);
else
if (isCjsPromise) {
if (!isCjsPromise.resolve) {
isCjsPromise.resolve(promise);
isCjsPromise.resolve = undefined;
}
}
else {
isCjsPromises[id] = { promise: promise, resolve: undefined };
}
}

return {
Expand Down

0 comments on commit 95b5f70

Please sign in to comment.