最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - how to include specific js file in ember.js - Stack Overflow

programmeradmin1浏览0评论

I added a .js file into my bower_ponents folder in my ember app. The file is included in my ember-cli-build.js like app.import('bower_ponents/script.js'). The app is working correctly on localhost but when i try to upload my app to heroku i got the error message no such file or directory script.

My question is where shall i put the script.js file? Shall i import it somewhere in my app?

I added a .js file into my bower_ponents folder in my ember app. The file is included in my ember-cli-build.js like app.import('bower_ponents/script.js'). The app is working correctly on localhost but when i try to upload my app to heroku i got the error message no such file or directory script.

My question is where shall i put the script.js file? Shall i import it somewhere in my app?

Share Improve this question asked Jun 25, 2016 at 8:49 embergalembergal 1591 gold badge2 silver badges7 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

bower_ponents folder is transient and is not good place for your file.

Move script.js to vendor folder

This is covered in the documentation, under

Addons and Dependencies > Managing Dependencies > Other Assets


From the documentation

Other assets

Assets not available as an addon or Bower package should be placed in the vendor folder in your project.


So your script.js would go under vendor/. And then in your ember-cli-build.js file, you would do a app.import('vendor/script.js').

发布评论

评论列表(0)

  1. 暂无评论