Skip to content

Commit

Permalink
Merge pull request #21128 from mrdoob/multiple
Browse files Browse the repository at this point in the history
Three.js: Log a warning when importing multiple instances of the library
  • Loading branch information
mrdoob committed Jan 21, 2021
2 parents 57876fc + 6182717 commit 952a482
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Three.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,14 @@ if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
/* eslint-enable no-undef */

}

if ( typeof __THREE__ !== undefined ) {

console.warn( 'WARNING: Multiple instances of Three.js being imported.' );

} else {

// eslint-disable-next-line no-undef
__THREE__ = REVISION;

}

0 comments on commit 952a482

Please sign in to comment.