vue3 vite使用 monaco-editor 报错

报错:Unexpected usage at EditorSimpleWorker.loadForeignModule

修改配置:

 "monaco-editor-webpack-plugin": "^4.2.0",删除不用

版本:

 "monaco-editor": "^0.28.1",

 修改如下:

 optimizeDeps: {
    include: [
      `monaco-editor/esm/vs/language/json/json.worker`,
      `monaco-editor/esm/vs/language/css/css.worker`,
      `monaco-editor/esm/vs/language/html/html.worker`,
      `monaco-editor/esm/vs/language/typescript/ts.worker`,
      `monaco-editor/esm/vs/editor/editor.worker`,
    ],
  },
  transpileDependencies: true,
  configureWebpack: {
    plugins: [],
  },

vue3 vite使用 monaco-editor 报错_第1张图片

 文件中的代码





你可能感兴趣的:(前端,javascript,vue.js)