The TypeScript Sandbox is based on Monaco and is loaded very similarly, but with some extra scripts:
require.config({
paths: {
vs: 'https://typescript.azureedge.net/cdn/4.0.5/monaco/min/vs',
// vs: 'https://unpkg.com/@typescript-deploys/monaco-editor@4.0.5/min/vs',
sandbox: 'https://www.typescriptlang.org/js/sandbox',
},
// This is something you need for monaco to work
ignoreDuplicateModules: ['vs/editor/editor.main'],
})
// Grab a copy of monaco, TypeScript and the sandbox
require(['vs/editor/editor.main', 'vs/language/typescript/tsWorker', 'sandbox/index'], (
main,
_tsWorker,
sandboxFactory
) => {
If this library could add support for loading additional scripts and getting a handle on the result, that would be super useful.
I don't think I'll be able to do it right away (so please feel free to beat me!) but I may be able to take a look at this at some point if you'd be open to a PR.
The TypeScript Sandbox is based on Monaco and is loaded very similarly, but with some extra scripts:
If this library could add support for loading additional scripts and getting a handle on the result, that would be super useful.
I don't think I'll be able to do it right away (so please feel free to beat me!) but I may be able to take a look at this at some point if you'd be open to a PR.