gpt4 book ai didi

javascript - 使用 require js 导入 Monaco Editor

转载 作者:行者123 更新时间:2023-11-30 15:26:40 25 4
gpt4 key购买 nike

我已经使用安装了 monaco-editor

npm install monaco-editor

现在我想在我的 js 文件中要求

所以我尝试要求使用

var monaco = require('monaco-editor');

但它给我找不到模块错误。

我做错了吗?

最佳答案

他们刚刚发布了与 webpack 等兼容的 ESM 发行版。查看文档 here .

还有很多将 monaco 与 webpack 结合使用的示例, parcel等等。 See all.

关于javascript - 使用 require js 导入 Monaco Editor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42857534/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com