Skip to content

Commit

Permalink
broccoli/ember-app: Make app/index.html optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Mar 22, 2017
1 parent c46579d commit 8bcb5f7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/broccoli/ember-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ class EmberApp {
index = this._rawAppIndex(htmlName);

} else {
let appIndex = this._rawAppIndex(htmlName);
let appIndex = this._rawAppIndex(htmlName, true);
let srcIndex = this._rawSrcIndex(htmlName);
index = this._mergeTrees([appIndex, srcIndex], { overwrite: true });
}
Expand All @@ -681,9 +681,9 @@ class EmberApp {
});
}

_rawAppIndex(outputPath) {
_rawAppIndex(outputPath, optional) {
return new Funnel(this.trees.app, {
files: ['index.html'],
[optional ? 'include' : 'files']: ['index.html'],
getDestinationPath: () => outputPath,
annotation: 'Funnel: index.html',
});
Expand Down
18 changes: 18 additions & 0 deletions tests/unit/broccoli/ember-app/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,23 @@ describe('EmberApp.index()', function() {
'index.html': 'src',
});
}));

it('works if only "src/ui/index.html" exists', co.wrap(function *() {
input.write({
'app': {},
'src': {
'ui': {
'index.html': 'src',
},
},
'config': {},
});

let app = createApp();
let output = yield buildOutput(app.index());
expect(output.read()).to.deep.equal({
'index.html': 'src',
});
}));
}
});

0 comments on commit 8bcb5f7

Please sign in to comment.