Skip to content

Commit e890b45

Browse files
authored
Merge pull request #368 from status200/ember-cli-2.13-compat
Monkeypatch correct `concatFiles` method
2 parents e71e664 + 559956c commit e890b45

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/ext/patch-ember-app.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ function patchEmberApp(emberApp) {
88
if (emberApp.addonPreconcatTree) { return; }
99

1010
// Save off original implementation of the `concatFiles` hook
11-
var originalConcatFiles = emberApp.concatFiles;
11+
var concatDeprecated = emberApp._concatFiles !== undefined;
12+
var originalConcatFiles = concatDeprecated ? emberApp._concatFiles : emberApp.concatFiles;
1213

1314
// Install method to invoke `preconcatTree` hook on each addon
1415
emberApp.addonPreconcatTree = addonPreconcatTree;
@@ -17,12 +18,18 @@ function patchEmberApp(emberApp) {
1718
// and, if it detects that it's a concat for the app tree, invokes our
1819
// preconcat hook. Afterwards, we invoke the original implementation to
1920
// return a tree concating the files.
20-
emberApp.concatFiles = function(tree, options) {
21+
var concatFiles = function(tree, options) {
2122
if (options.annotation === 'Concat: App') {
2223
tree = this.addonPreconcatTree(tree);
2324
}
2425
return originalConcatFiles.apply(this, arguments);
2526
};
27+
if (concatDeprecated) {
28+
emberApp._concatFiles = concatFiles;
29+
} else {
30+
emberApp.concatFiles = concatFiles;
31+
}
32+
2633
}
2734

2835
function addonPreconcatTree(tree) {

0 commit comments

Comments
 (0)