【发布时间】:2020-05-23 12:13:15
【问题描述】:
我尝试将 monaco code 编辑器集成到我的 ember octane 应用程序中。目前我正在使用 ESM 导入样式并确认手册,我安装了 webpack loader 插件并将其集成到我的 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) 您可能需要适当的加载程序来处理此文件类型。
还有
(node:7993) UnhandledPromiseRejectionWarning: 错误:webpack 将错误返回到 ember-auto-import
谁能帮助我并告诉我如何将 monaco 正确集成到我的 ember 应用程序中? 非常感谢!
【问题讨论】:
-
我不确定这是否适用于当前的 ember 构建管道。你试过了吗,ember-monaco?
标签: webpack ember.js monaco-editor ember-octane