Back to packages list![maxm avatar](https://img.clerk.com/eyJ0eXBlIjoicHJveHkiLCJzcmMiOiJodHRwczovL2ltYWdlcy5jbGVyay5kZXYvdXBsb2FkZWQvaW1nXzJnTEtkSHlOMWxWZm1GRHdKYUVTNklYM3FpdiJ9)
Vals using build
Description from the NPM package:
An ant-like build program for node
codemirrorTsBrowser
@maxm
Script
codemirror-ts You can import this a val like this in browser to run codemirror-ts. Bundling done with esm.sh. Working demo: preview / source Run an editor like so: /** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request): Promise<Response> {
return new Response(
renderToString(
<>
<script type="module" src="https://esm.town/v/maxm/codemirrorTsBrowser" />
<form>
<textarea id="editorSource" className="for-codemirror" name="editorSource">
{`let hasAnError: string = 10;
function increment(num: number) {
return num + 1;
}
increment('not a number');`}
</textarea>
<button id="submit" type="submit">Submit</button>
</form>
</>,
),
{ headers: { "content-type": "text/html" } },
);
}