diff --git a/importmap.json b/importmap.json index 7725daf..46fd4e0 100644 --- a/importmap.json +++ b/importmap.json @@ -5,6 +5,7 @@ "./": "./src/", "oak": "https://deno.land/x/oak/mod.ts", + "@babel/": "https://esm.sh/@babel/", "react": "https://esm.sh/react", "react-dom": "https://esm.sh/react-dom", diff --git a/src/app_server.tsx b/src/app_server.tsx index f8f7f66..1ed5a46 100644 --- a/src/app_server.tsx +++ b/src/app_server.tsx @@ -3,7 +3,7 @@ import React from "react"; import ReactDOMServer from "react-dom/server"; import App from "/app.tsx"; import { ServerStyleSheet } from 'styled-components' - +import Babel from "https://dev.jspm.io/@babel/standalone"; const Bundle = {JS:"", CSS:"", HTML:""}; @@ -14,6 +14,7 @@ Deno.emit("./src/app_client.tsx", { }).then(result => { Bundle.JS = result.files["deno:///bundle.js"]; + Bundle.JS = Babel.transform(Bundle.JS, {presets:["env"]}).code; // LOL XDDDDD console.log("bundle built"); });