我尝试按照演示将引擎安装到我的项目中:
正在使用的应用: https://github.com/dgeb/ember-engines-demo
引擎应用程序: https://github.com/dgeb/ember-blog-engine
演示效果很好。
但是,当我将ember-blog-engine挂载到自己的使用应用程序时,会发生错误并且错误消息是
"Error: Could not find module ember-blog-engine/engine imported from (require)".
我如何添加引擎:
"dependencies": {
"ember-engines": "0.6.3",
"ember-blog-engine": "path-to/ember-blog-engine",
...
},
this.mount('ember-blog-engine', {as: 'blog'});
我发现ember-blog-engine的源代码从来没有内置到vendor.js中,当执行ember build
时,控制台显示引擎处于无效模块中。 ember构建控制台的列表如下:
...
addon-tree-output/modules/ember-blog-engine/components/date-picker.js
addon-tree-output/modules/ember-blog-engine/config/environment.js
addon-tree-output/modules/ember-blog-engine/engine.js
addon-tree-output/modules/ember-blog-engine/initializers/hello.js
addon-tree-output/modules/ember-blog-engine/instance-initializers/hello-instance.js
addon-tree-output/modules/ember-blog-engine/routes.js
addon-tree-output/modules/ember-blog-engine/routes/application.js
addon-tree-output/modules/ember-blog-engine/routes/index.js
addon-tree-output/modules/ember-blog-engine/routes/new.js
addon-tree-output/modules/ember-blog-engine/routes/post.js
addon-tree-output/modules/ember-blog-engine/routes/post/comments.js
addon-tree-output/modules/ember-blog-engine/templates/application.js
addon-tree-output/modules/ember-blog-engine/templates/components/date-picker.js
addon-tree-output/modules/ember-blog-engine/templates/index.js
addon-tree-output/modules/ember-blog-engine/templates/new.js
addon-tree-output/modules/ember-blog-engine/templates/post.js
addon-tree-output/modules/ember-blog-engine/templates/post/comments.js
addon-tree-output/modules/ember-blog-engine/templates/post/index.js
...
dead 239
traversed 1347