ember-cli adding dependencies with bower

假如想象 提交于 2019-12-03 12:51:24

You didn't share your Brocfile.js, but I've had similar issues when I've added dependencies after the module.exports = app.toTree(); line at the end of that file. The documentation is not terribly clear about this, but module.exports = app.toTree(); should always come last in Brocfile.js. Try moving your app.import() statement above this line and things should work correctly.

Update

Pulling down your repo I noticed a few issues. First is that you need to pass --save-dev to your bower installs for bootstrap and typeahead.js in order for those to be installed when others pull down your repo. That will add a section like this to your bower.json:

"devDependencies": {
   "bootstrap": "~3.2.0",
   "typeahead.js": "~0.10.5"
 }

I also added "Bloodhound": true to the prefdef section of .jshintrc to avoid jshint errors on build:

 "predef": {
    "document": true,
    "window": true,
    "-Promise": true,
    "Bloodhound": true
  },

You can also replace your $ references in index.js with Ember.$ to avoid another jshint error.

Once I did this I was able to run ember serve and have the app load without any Bloodhound issues.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!