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

Commit

Permalink
chore(): ensure the order of entryModuleIds does not get changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
jthoms1 committed Jan 26, 2018
1 parent d8879a8 commit 370bf07
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export default function commonjs ( options = {} ) {
() => false;

let entryModuleIdsPromise = null;
const entryModuleIds = [];

function resolveId ( importee, importer ) {
if ( importee === HELPERS_ID ) return importee;
Expand Down Expand Up @@ -135,11 +134,7 @@ export default function commonjs ( options = {} ) {

const entryModules = [].concat( options.input || options.entry );
entryModuleIdsPromise = Promise.all(
entryModules.map( entry =>
resolveId( entry ).then( resolved => {
entryModuleIds.push( resolved );
})
)
entryModules.map( entry => resolveId( entry ))
);
},

Expand Down Expand Up @@ -173,7 +168,7 @@ export default function commonjs ( options = {} ) {
if ( !filter( id ) ) return null;
if ( extensions.indexOf( extname( id ) ) === -1 ) return null;

return entryModuleIdsPromise.then( () => {
return entryModuleIdsPromise.then( (entryModuleIds) => {
const {isEsModule, hasDefaultExport, ast} = checkEsModule( code, id );
if ( isEsModule ) {
if ( !hasDefaultExport )
Expand Down

0 comments on commit 370bf07

Please sign in to comment.