embergal
embergal

Reputation: 159

how to include specific js file in ember.js

I added a .js file into my bower_components folder in my ember app. The file is included in my ember-cli-build.js like app.import('bower_components/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?

Upvotes: 2

Views: 2616

Answers (2)

Vishak Partha
Vishak Partha

Reputation: 80

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

Upvotes: 3

Ebrahim Pasbani
Ebrahim Pasbani

Reputation: 9406

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

Move script.js to vendor folder

Upvotes: 5

Related Questions