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

Commit

Permalink
update rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Apr 26, 2018
1 parent cd835c4 commit bba42a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"locate-character": "^2.0.5",
"mocha": "^5.0.1",
"require-relative": "^0.8.7",
"rollup": "^0.56.4",
"rollup": "^0.58.0",
"rollup-plugin-buble": "^0.19.2",
"rollup-plugin-node-resolve": "^3.0.3",
"shx": "^0.2.2",
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function commonjs ( options = {} ) {
let resolveUsingOtherResolvers;

const isCjsPromises = Object.create(null);
function getIsCjsTransformPromise ( id ) {
function getIsCjsPromise ( id ) {
let isCjsPromise = isCjsPromises[id];
if (isCjsPromise)
return isCjsPromise.promise;
Expand Down Expand Up @@ -178,9 +178,9 @@ export default function commonjs ( options = {} ) {
const actualId = id.slice( PREFIX.length );
const name = getName( actualId );

return getIsCjsTransformPromise( actualId )
.then( isCjsTransform => {
if ( isCjsTransform )
return getIsCjsPromise( actualId )
.then( isCjs => {
if ( isCjs )
return `import { __moduleExports } from ${JSON.stringify( actualId )}; export default __moduleExports;`;
else if (esModulesWithoutDefaultExport.indexOf(actualId) !== -1)
return `import * as ${name} from ${JSON.stringify( actualId )}; export default ${name};`;
Expand Down

0 comments on commit bba42a8

Please sign in to comment.