# Adding external js and css files in ember-cli

**URL:** <https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596>\
**Category:** Uncategorized\
**Created:** [January 29, 2016, 5:49am UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596 "2016-01-29T05:49:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nagkumar](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/nagkumar/32/11861_2.png) [@nagkumar](https://discuss.emberjs.com/u/nagkumar)\
**Post date:** [January 29, 2016, 5:49am UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/1 "2016-01-29T05:49:21Z")

</div>

Hi,

I wish to add external js and css files to ember-cli project, is it possible to put this files some where say vendor folder and import it in index.html etc… rather than add-on approach

Regards Nagendra

---

<div class="post-metadata">

**Author:** ![skaterdav85](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/skaterdav85/32/18291_2.png) [@skaterdav85](https://discuss.emberjs.com/u/skaterdav85)\
**Post date:** [January 29, 2016, 9:04am UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/2 "2016-01-29T09:04:28Z")

</div>

Place them in your ember-cli-build.js file, like this: [itp/ember-cli-build.js at master · iamdtang/itp · GitHub](https://github.com/skaterdav85/itp/blob/master/ember-cli-build.js)

---

<div class="post-metadata">

**Author:** ![nagkumar](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/nagkumar/32/11861_2.png) [@nagkumar](https://discuss.emberjs.com/u/nagkumar)\
**Post date:** [January 30, 2016, 2:34pm UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/3 "2016-01-30T14:34:23Z")

</div>

Few more approaches are outlined at [How to include folder of assets into ember app with ember cli](http://discuss.emberjs.com/t/how-to-include-folder-of-assets-into-ember-app-with-ember-cli/7763)

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [January 31, 2016, 7:27am UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/4 "2016-01-31T07:27:44Z")

</div>

Anything you put in `/public` ends up in the `/dist` folder and then can be included via your html document (index.html, or whatever it may be). I don’t understand the use of broccoli-funnel here.

 ![](https://us1.discourse-cdn.com/flex019/uploads/emberjs_public/original/2X/b/bd318654c85d04ffb43d6e7d640867eac17971e1.png)

---

<div class="post-metadata">

**Author:** ![rmcsharry](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/rmcsharry/32/12570_2.png) [@rmcsharry](https://discuss.emberjs.com/u/rmcsharry)\
**Post date:** [September 12, 2016, 5:46pm UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/5 "2016-09-12T17:46:49Z")

</div>

What about adding files that are externally hosted? They aren’t in /vendor … so do you just use app.import(‘https://…’) in the ember-cli-build file?

I tried that and get this error:

Build failed. The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with: Error: ENOENT: no such file or directory,

---

<div class="post-metadata">

**Author:** ![Sinrise](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/sinrise/32/12855_2.png) [@Sinrise](https://discuss.emberjs.com/u/Sinrise)\
**Post date:** [February 10, 2017, 12:00am UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/6 "2017-02-10T00:00:31Z")

</div>

I wasn’t able to get this to work. Ember server returns an error: The Broccoli Plugin: [SourceMapConcat: Concat: Vendor /assets/vendor.js] failed with: Error: ENOENT: no such file or directory

---

<div class="post-metadata">

**Author:** ![Sinrise](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/sinrise/32/12855_2.png) [@Sinrise](https://discuss.emberjs.com/u/Sinrise)\
**Post date:** [February 10, 2017, 12:08am UTC](https://discuss.emberjs.com/t/adding-external-js-and-css-files-in-ember-cli/9596/7 "2017-02-10T00:08:16Z")

</div>

I don’t either, and it seems that’s because it just doesn’t work that way. Apparently, ember-cli.build.js isn’t intended to be used like a bundler or dependency injector, I guess. You’d need an extension for bundling/minification, and add your compiled file to the public folder (works in a subfolder, too). I hope that makes sense.
