babel transform

This commit is contained in:
TreetopFlyer 2021-07-16 17:27:39 -04:00
parent ee40fd997c
commit f44cc9331c
2 changed files with 3 additions and 1 deletions

View File

@ -5,6 +5,7 @@
"./": "./src/", "./": "./src/",
"oak": "https://deno.land/x/oak/mod.ts", "oak": "https://deno.land/x/oak/mod.ts",
"@babel/": "https://esm.sh/@babel/",
"react": "https://esm.sh/react", "react": "https://esm.sh/react",
"react-dom": "https://esm.sh/react-dom", "react-dom": "https://esm.sh/react-dom",

View File

@ -3,7 +3,7 @@ import React from "react";
import ReactDOMServer from "react-dom/server"; import ReactDOMServer from "react-dom/server";
import App from "/app.tsx"; import App from "/app.tsx";
import { ServerStyleSheet } from 'styled-components' import { ServerStyleSheet } from 'styled-components'
import Babel from "https://dev.jspm.io/@babel/standalone";
const Bundle = {JS:"", CSS:"", HTML:""}; const Bundle = {JS:"", CSS:"", HTML:""};
@ -14,6 +14,7 @@ Deno.emit("./src/app_client.tsx", {
}).then(result => }).then(result =>
{ {
Bundle.JS = result.files["deno:///bundle.js"]; Bundle.JS = result.files["deno:///bundle.js"];
Bundle.JS = Babel.transform(Bundle.JS, {presets:["env"]}).code; // LOL XDDDDD
console.log("bundle built"); console.log("bundle built");
}); });