Where do 3rd party JS libraries go?

2.2k Views Asked by At

In an Ember CLI app. If one wanted to use https://github.com/twbs/bootstrap/blob/master/js/tooltip.js

http://www.ember-cli.com/ does not seem to mention anything specific about this.

Where would this file typically be stored? At first glance, I was thinking of putting it in public/assets/js. What is the convention, if any?

2

There are 2 best solutions below

5
mistahenry On BEST ANSWER

Yes there is a convention. Use bower if a package exists. If it doesn't, download the repo into the vendor folder. Import the file in your Brocfile.js

app.import('vendor/path_to/main_js_file.js');
0
Rimian On

Yes, use bower or place them in vendor/. Then register them in ember-cli-build.js

Here's the documentation: https://guides.emberjs.com/v2.14.0/addons-and-dependencies/managing-dependencies/