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

Commit

Permalink
Fix #232 - require collision.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Oct 7, 2017
1 parent 419a912 commit 93cedc2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/transform.js
Expand Up @@ -91,7 +91,11 @@ export default function transformCommonjs ( code, id, isEntry, ignoreGlobal, ign
if ( existing === undefined ) {
sources.push( source );

if ( !name ) name = `require$$${uid++}`;
if ( !name ) {
do name = `require$$${uid++}`;
while ( scope.contains( name ) );
}

required[ source ] = { source, name, importsDefault: false };
}

Expand Down

0 comments on commit 93cedc2

Please sign in to comment.