DEV: Allow us to keep the deprecation with Ember CLI

DEV: Allow us to keep the deprecation with Ember CLI

diff --git a/app/assets/javascripts/discourse/app/models/site.js b/app/assets/javascripts/discourse/app/models/site.js
index 455368b..03aee34 100644
--- a/app/assets/javascripts/discourse/app/models/site.js
+++ b/app/assets/javascripts/discourse/app/models/site.js
@@ -216,18 +216,20 @@ Site.reopenClass(Singleton, {
   }
 });
 
-let warned = false;
-Object.defineProperty(Discourse, "Site", {
-  get() {
-    if (!warned) {
-      deprecated("Import the Site class instead of using Discourse.Site", {
-        since: "2.4.0",
-        dropFrom: "2.6.0"
-      });
-      warned = true;
+if (typeof Discourse !== "undefined") {
+  let warned = false;
+  Object.defineProperty(Discourse, "Site", {
+    get() {
+      if (!warned) {
+        deprecated("Import the Site class instead of using Discourse.Site", {
+          since: "2.4.0",
+          dropFrom: "2.6.0"
+        });
+        warned = true;
+      }
+      return Site;
     }
-    return Site;
-  }
-});
+  });
+}
 
 export default Site;

GitHub sha: 46730a2f