Open tearf001 opened 2 years ago
These codes work. yyx990803 on 29 Jan 2021 I just looked into it and it seems Monaco Editor's ESM usage requires pre-bundling the workers:
{ // root of vite.config.js options
optimizeDeps: {
include: [
....// others
`${prefix}/language/json/json.worker`,
`${prefix}/language/css/css.worker`,
`${prefix}/language/html/html.worker`,
`${prefix}/language/typescript/ts.worker`,
`${prefix}/editor/editor.worker`
]
}
}
ref: https://github.com/microsoft/monaco-editor/blob/master/docs/integrate-esm.md
Thanks to the demo, I run the demo,it worked fine. But when I use it in
Vue Router
it failed in
what did I miss?