4
votes

I'm trying to have two apps, that are related, but have different access points from the server. Currently ember build returns on index.html in dist/. This is with the following setup:

/* global require, module */

var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var mergeTrees = require('broccoli-merge-trees');

var app = new EmberApp();
var viewer = new EmberApp({
  storeConfigInMeta: false,
  trees: {
    app: 'viewer',
    templates: 'viewer/templates',
    styles: 'viewer/styles'
  },

  outputPaths: {
    app: {
      css: '/assets/viewer.css',
      js: '/assets/viewer.js'
    },

    vendor: {
      css: '/assets/viewer-vendor.css',
      js: '/assets/viewer-vendor.js'
    }
  }
});

app.import('bower_components/socket.io-client/socket.io.js');
viewer.import('bower_components/socket.io-client/socket.io.js');

module.exports = mergeTrees([viewer.toTree(), app.toTree()], { overwrite: true });

I would like to be able to specify the html output path as well, but after looking around in https://github.com/stefanpenner/ember-cli/blob/master/lib/broccoli/ember-app.js I'm no smarter about what I should do. Also using different configs, which doesn't really work with configPath.. errors:

ENOENT, no such file or directory '/Users/user/project/tmp/tree_merger-tmp_dest_dir-fen1Dz3z.tmp/project/config/environment.js'

2

2 Answers

1
votes

Ok, looks like the next version of ember-cli will support this (current is 0.1.2). See this merged PR: https://github.com/stefanpenner/ember-cli/pull/2523

So this isn't possible with this version, but will be with the next, as:

app: {
  html: 'my-custom.html'
}

Edit

This feature was introduced by this PR and released in v0.1.3, see the changelog.

0
votes

I think this will solve your problem. Multiple "apps" with ember-cli

The question is about multiple apps in ember cli