小编anr*_*nie的帖子

使用webpack导入monaco-editor时找不到依赖项

vuejs代码:

import monaco from "monaco-editor/min/vs/loader.js";
Run Code Online (Sandbox Code Playgroud)

webpack.base.conf.js:

entry: {
    app: './src/main.js'
},
output:{
    path:resolve(__dirname, '../dist'),
    filename:'[name].js',
    publicPath: '/'
}
Run Code Online (Sandbox Code Playgroud)

我使用webpack的monaco-editor,但我甚至无法导入loader.js.看起来像monaco-editor/vs下的js文件不允许加载.

终端输出:

These dependencies were not found:
* vs/editor/edcore.main in ./~/monaco-editor/min/vs/editor/editor.main.js
* vs/language/typescript/src/mode in ./~/monaco-editor/min/vs/editor/editor.main.js
* fs in ./~/monaco-editor/min/vs/language/typescript/lib/typescriptServices.js
Run Code Online (Sandbox Code Playgroud)

我能做什么?

node.js webpack vue.js

5
推荐指数
1
解决办法
707
查看次数

标签 统计

node.js ×1

vue.js ×1

webpack ×1