2

My ember application has a few distinct components. There is a lot of code, so I want the sources organized into separate directories.

Let's say I have this directory structure:

[app]
  - [controllers]
  - [models]
  - [routes]
  - [views]
[dashboard]
  - [controllers]
  - [models]
  - [routes]
  - [views]
[admin]
  - [controllers]
  - [models]
  - [routes]
  - [views]

I want these directories all merged into app at build-time. I don't need to support conflicting names, e.g. app/controllers/foo.js + dashboard/controllers/foo.js.

My goal is a basic level of organization. I don't want to prefix /dashboard/ all over the app, and I don't want to slow down the build.

Similar to this question: Multiple "apps" with ember-cli which I understand the ember-cli folks are working on and that it's not ready yet.

Any other ideas on how to organize the app are more than welcome.


I tried this, but the files in dashboard are being ignored.

// Brocfile.js
var mergeTrees = require('broccoli-merge-trees');

var app = new EmberApp();
var dashboard = new EmberApp({
    trees: {
        app: 'dashboard'
    }
});

module.exports = mergeTrees([ dashboard.toTree(), app.toTree() ], { overwrite: true });
Community
  • 1
  • 1
dwickern
  • 3,519
  • 1
  • 14
  • 21
  • 1
    Do you try to use addons for dashboard and admin? I used addon to separate some models and the only disadvantage is that livereload doesn't work on addon changing. – artych Jul 14 '15 at 17:50
  • I haven't tried addons. I definitely want live reloading to work. – dwickern Jul 14 '15 at 17:54
  • I created an addon using the `in-repo-addon` blueprint. File watching and live reloading does seem to work. This looks promising! – dwickern Jul 14 '15 at 18:25

0 Answers0