Explorar el Código

Encoding errors with the typescript file? No idea why

Reddo hace 5 años
padre
commit
7ca343218b
Se han modificado 2 ficheros con 5 adiciones y 3 borrados
  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/**/*"]