Sfoglia il codice sorgente

Merge pull request #21128 from mrdoob/multiple

Three.js: Log a warning when importing multiple instances of the library
Mr.doob 4 anni fa
parent
commit
952a482a93
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      src/Three.js

+ 11 - 0
src/Three.js

@@ -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;
+
+}