Skip to content

Commit 952a482

Browse files
authored
Merge pull request #21128 from mrdoob/multiple
Three.js: Log a warning when importing multiple instances of the library
2 parents 57876fc + 6182717 commit 952a482

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Three.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,14 @@ if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
164164
/* eslint-enable no-undef */
165165

166166
}
167+
168+
if ( typeof __THREE__ !== undefined ) {
169+
170+
console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
171+
172+
} else {
173+
174+
// eslint-disable-next-line no-undef
175+
__THREE__ = REVISION;
176+
177+
}

0 commit comments

Comments
 (0)