esbuild TSX

incremental-dom
Brian Sakal 2 years ago
parent b45f44c25e
commit 631fa37785

@ -7,7 +7,7 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "cp src/index.html dist/ && yarn esbuild src/index.tsx --outdir=dist --platform=browser --bundle --format=esm", "build": "cp src/index.html dist/ && yarn esbuild src/index.tsx --outdir=dist --platform=browser --bundle --format=esm",
"serve": "cp src/index.html dist/ && yarn esbuild src/index.tsx --outdir=dist --platform=browser --bundle --format=esm --servedir=dist" "serve": "cp src/index.html dist/ && yarn esbuild src/index.tsx --outdir=dist --platform=browser --bundle --format=esm --jsx-factory=createElement --jsx-fragment=Fragment --servedir=dist"
}, },
"devDependencies": { "devDependencies": {
"esbuild": "^0.17.18" "esbuild": "^0.17.18"

@ -0,0 +1,13 @@
import { React } from "./React";
export function App({ numberOfTicks=5 }){
return (
<>
<div class="header">
<h1>Choose Probabilities</h1>
<h5>X-Axis = Ticks, Y-Axis = Underlying Price</h5>
</div>
<div class="chart"></div>
</>
);
}

@ -0,0 +1,4 @@
import { createElement } from "inferno-create-element";
import { Fragment } from "inferno";
export const React = {createElement, Fragment};

@ -1,11 +1,6 @@
import { render } from "inferno"; import { render } from "inferno";
import { createElement } from "inferno-create-element"; import { App } from "./App";
const React = {createElement}; import { React } from "./React";
function App(){
return (
<h1>Hello Binomial</h1>
);
}
render(<App />, document.getElementById("app")); render(<App />, document.getElementById("app"));
Loading…
Cancel
Save