# How to compile files before ember creates ember-app.js file

**URL:** <https://discuss.emberjs.com/t/how-to-compile-files-before-ember-creates-ember-app-js-file/9020>\
**Category:** Uncategorized\
**Created:** [October 28, 2015, 6:52am UTC](https://discuss.emberjs.com/t/how-to-compile-files-before-ember-creates-ember-app-js-file/9020 "2015-10-28T06:52:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![araviselvam](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@araviselvam](https://discuss.emberjs.com/u/araviselvam)\
**Post date:** [October 28, 2015, 6:52am UTC](https://discuss.emberjs.com/t/how-to-compile-files-before-ember-creates-ember-app-js-file/9020/1 "2015-10-28T06:52:29Z")

</div>

i want to create an application which has to take files from outside the application for a particular route and add those route template and controller to the application… is this possible in ember

---

<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:** [October 28, 2015, 7:15am UTC](https://discuss.emberjs.com/t/how-to-compile-files-before-ember-creates-ember-app-js-file/9020/2 "2015-10-28T07:15:26Z")

</div>

What you’re asking isn’t very clear, maybe you want to reword it.

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [October 28, 2015, 2:58pm UTC](https://discuss.emberjs.com/t/how-to-compile-files-before-ember-creates-ember-app-js-file/9020/3 "2015-10-28T14:58:10Z")

</div>

Yes, this is possible. You would do it by customizing ember-cli-build.js something like this:

```
var stew = require('broccoli-stew');
var mergeTrees = require('broccoli-merge-trees');
module.exports = function(defaults) {
  return new EmberApp(defaults, {
    trees: {
      app: mergeTrees(['app', stew.find('/some-other-path', '*.js')])
    }
  ]);
};

```

This is merging some extra stuff into the “app” tree, which means it’s equivalent to dropping files under your “app” directory.
