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 });