keep newt.js separate in playground

This commit is contained in:
2024-11-20 19:45:32 -08:00
parent 1a9d44434c
commit 7c8c0c9df0
4 changed files with 6 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
declare module "*.css";
export {};
declare global {
// typescript doesn't know worker.ts is a worker
function importScripts(...scripts: string[]): void;
interface Process {
platform: string;
stdout: {

View File

@@ -74,6 +74,7 @@ function Editor({ initialValue }: EditorProps) {
value,
language: "newt",
theme: "vs",
fontFamily: "Comic Code, Menlo, Monaco, Courier New, sans",
automaticLayout: true,
acceptSuggestionOnEnter: "off",
unicodeHighlight: { ambiguousCharacters: false },

View File

@@ -153,3 +153,4 @@ onmessage = async function (e) {
let output = stdout
postMessage({javascript, output, duration})
}
importScripts('newt.js')