chore: set monaco-editor jsx as preserve

This commit is contained in:
Amour1688 2020-09-06 11:33:12 +08:00
parent 53739e1d5c
commit f519920db2

View File

@ -42,15 +42,13 @@ window.init = () => {
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
allowJs: true,
allowNonTsExtensions: true,
lib: [],
jsx: monaco.languages.typescript.JsxEmit.React,
jsx: monaco.languages.typescript.JsxEmit.Preserve,
target: monaco.languages.typescript.ScriptTarget.Latest,
typeRoots: ['node_modules/@types'],
});
const editor = monaco.editor.create(document.getElementById('source')!, {
value: decodeURIComponent(window.location.hash.slice(1)) || localStorage.getItem('state') || 'const App = () => <div>Hello World</div>',
language: 'javascript',
language: 'typescript',
tabSize: 2,
...sharedEditorOptions,
});