소스 검색

Lottie: Add document check for SSR. (#26989)

Cody Bennett 1 년 전
부모
커밋
de5932e063
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      examples/jsm/libs/lottie_canvas.module.js

+ 6 - 1
examples/jsm/libs/lottie_canvas.module.js

@@ -1,3 +1,7 @@
+const lottie = {};
+
+if (typeof document !== 'undefined') {
+
 const svgNS = 'http://www.w3.org/2000/svg';
 
 let locationHref = '';
@@ -4547,7 +4551,6 @@ const Matrix = (function () {
   };
 }());
 
-const lottie = {};
 var standalone = '__[STANDALONE]__';
 var animationData = '__[ANIMATIONDATA]__';
 var renderer = '';
@@ -14841,4 +14844,6 @@ setExpressionsPlugin(Expressions);
 initialize$1();
 initialize();
 
+}
+
 export { lottie as default };