2024-09-27 16:14:20 +00:00
|
|
|
import { createApp } from 'vue';
|
|
|
|
import './style.css';
|
|
|
|
import App from './App.vue';
|
|
|
|
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker';
|
|
|
|
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker';
|
|
|
|
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker';
|
|
|
|
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker';
|
|
|
|
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker';
|
2024-06-21 04:32:55 +00:00
|
|
|
|
2024-09-27 16:14:20 +00:00
|
|
|
self.MonacoEnvironment = {
|
|
|
|
getWorker(_, label) {
|
|
|
|
if (label === 'json') {
|
|
|
|
return new jsonWorker();
|
|
|
|
}
|
|
|
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
|
|
|
return new cssWorker();
|
|
|
|
}
|
|
|
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
|
|
|
return new htmlWorker();
|
|
|
|
}
|
|
|
|
if (label === 'typescript' || label === 'javascript') {
|
|
|
|
return new tsWorker();
|
|
|
|
}
|
|
|
|
return new editorWorker();
|
|
|
|
},
|
|
|
|
};
|
|
|
|
createApp(App).mount('#app');
|