From 618271791cbce7324ff24115d9ea5770efb3f9b3 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Thu, 21 Jan 2021 17:20:42 +0000 Subject: [PATCH] Three.js: Log a warning when importing multiple instances of the library. --- src/Three.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Three.js b/src/Three.js index 793db5abd57586..9606bcd67bcfdf 100644 --- a/src/Three.js +++ b/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; + +}