From f44cc9331ca50a5f878caff854c65774c29b143e Mon Sep 17 00:00:00 2001 From: TreetopFlyer Date: Fri, 16 Jul 2021 17:27:39 -0400 Subject: [PATCH] babel transform --- importmap.json | 1 + src/app_server.tsx | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) 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"); });