keep newt.js separate in playground
This commit is contained in:
@@ -4,6 +4,7 @@ esbuild --bundle node_modules/monaco-editor/esm/vs/editor/editor.worker.js > pub
|
|||||||
echo build newt worker
|
echo build newt worker
|
||||||
esbuild src/worker.ts > public/worker.js
|
esbuild src/worker.ts > public/worker.js
|
||||||
echo copy newt
|
echo copy newt
|
||||||
cat ../build/exec/newt.js |grep -v '^#'>> public/worker.js
|
cp ../build/exec/newt.js public
|
||||||
|
# cat ../build/exec/newt.js |grep -v '^#'>> public/worker.js
|
||||||
cp samples/* public
|
cp samples/* public
|
||||||
# esbuild --minify ../build/exec/newt.min.js > public/newt.js
|
# esbuild --minify ../build/exec/newt.min.js > public/newt.js
|
||||||
|
|||||||
2
playground/src/global.d.ts
vendored
2
playground/src/global.d.ts
vendored
@@ -1,6 +1,8 @@
|
|||||||
declare module "*.css";
|
declare module "*.css";
|
||||||
export {};
|
export {};
|
||||||
declare global {
|
declare global {
|
||||||
|
// typescript doesn't know worker.ts is a worker
|
||||||
|
function importScripts(...scripts: string[]): void;
|
||||||
interface Process {
|
interface Process {
|
||||||
platform: string;
|
platform: string;
|
||||||
stdout: {
|
stdout: {
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ function Editor({ initialValue }: EditorProps) {
|
|||||||
value,
|
value,
|
||||||
language: "newt",
|
language: "newt",
|
||||||
theme: "vs",
|
theme: "vs",
|
||||||
|
fontFamily: "Comic Code, Menlo, Monaco, Courier New, sans",
|
||||||
automaticLayout: true,
|
automaticLayout: true,
|
||||||
acceptSuggestionOnEnter: "off",
|
acceptSuggestionOnEnter: "off",
|
||||||
unicodeHighlight: { ambiguousCharacters: false },
|
unicodeHighlight: { ambiguousCharacters: false },
|
||||||
|
|||||||
@@ -153,3 +153,4 @@ onmessage = async function (e) {
|
|||||||
let output = stdout
|
let output = stdout
|
||||||
postMessage({javascript, output, duration})
|
postMessage({javascript, output, duration})
|
||||||
}
|
}
|
||||||
|
importScripts('newt.js')
|
||||||
|
|||||||
Reference in New Issue
Block a user