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

I added a .js file into my bower_ponents folder in my ember app. The file is included in my ember-cli-b

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').

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745274876a4619976.html

相关推荐

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

    I added a .js file into my bower_ponents folder in my ember app. The file is included in my ember-cli-b

    21小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信