我尝试将monaco 代码编辑器集成到我的 ember octane 应用程序中。目前我正在使用 ESM 导入样式并确认手册,我安装了 webpack 加载器插件并将其集成到我的 ember-cli-build.js
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
autoImport: {
webpack: {
plugins: [
new MonacoWebpackPlugin()
]
}
}
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
return app.toTree();
};
但是在构建我的应用程序时,我总是收到错误消息:
模块解析失败:意外令牌 (8:0) 您可能需要适当的加载程序来处理此文件类型。
和
(节点:7993)UnhandledPromiseRejectionWarning:错误:webpack 将错误返回到 ember-auto-import
谁能帮助我并告诉我如何将 monaco 正确集成到我的 ember 应用程序中?非常感谢你!