Browse Source

Encoding errors with the typescript file? No idea why

Reddo 5 years ago
parent
commit
7ca343218b
2 changed files with 5 additions and 3 deletions
  1. 2 2
      The Obelisk.haml
  2. 3 1
      tsconfig.json

+ 2 - 2
The Obelisk.haml

@@ -80,10 +80,10 @@
                 #roomExits
     -###########
     -# Relative File for Debugging
-    %script{:type => "text/javascript", :charset=>"utf8", :src => "../js/Application.js"}
+    -#%script{:type => "text/javascript", :charset=>"utf8", :src => "../js/Application.js"}
     -###########
     -# Optimized No Debug Data URL
-    -#= "<script id=\"ApplicationJS\" type=\"text/javascript\", charset=\"utf8\", src=\"data:application/javascript," + (URI.encode("(function(){\n" + (File.read "js/Application.js").gsub("console.debug(", "//")) + "\n})()") + "\"></script>";
+    = "<script id=\"ApplicationJS\" type=\"text/javascript\", charset=\"utf8\", src=\"data:application/javascript," + (URI.encode("(function(){\n" + (File.read "js/Application.js").encode!('UTF-8', 'UTF-8', :invalid => :replace).gsub("console.debug(", "//")) + "\n})()") + "\"></script>";
     -###########
     %style{:media=>"screen", :type=>"text/css"}
       = File.read "stylesheets/fonts.css"

+ 3 - 1
tsconfig.json

@@ -12,7 +12,9 @@
         "noUnusedLocals": true,
         "outFile": "js/Application.js",
         "types": [],
-        "moduleResolution": "node"
+        "moduleResolution": "node",
+        "emitBOM": true,
+        "charset": "utf8"
     },
     "exclude": ["js/**/*"],
     "include": ["app/**/*", "content/**/*"]