Skip to content

Commit

Permalink
Strip "app" and "addon" folders from the build
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Jan 10, 2017
1 parent a2db537 commit f2bc2da
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
26 changes: 25 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,29 @@ module.exports = {
});
}
}
}
},

treeForAddon: function() {
// remove our "addon" folder from the build if we're stripping test selectors
if (!this._stripTestSelectors) {
return this._super.treeForAddon.apply(this, arguments);
}
},

treeForApp: function() {
// remove our "app" folder from the build if we're stripping test selectors
if (!this._stripTestSelectors) {
return this._super.treeForApp.apply(this, arguments);
}
},

preprocessTree: function(type, tree) {
// remove the unit tests if we're testing ourself and are in strip mode.
// we do this because these tests depend on the "addon" and "app" folders being available,
// which is not the case if they are stripped out of the build.
if (type === 'test' && this._stripTestSelectors && this.project.name() === 'ember-test-selectors') {
tree = require('broccoli-stew').rm(tree, 'dummy/tests/unit/**/*.js');
}
return tree;
},
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"broccoli-stew": "^1.4.0",
"ember-ajax": "^2.4.1",
"ember-cli": "2.10.0",
"ember-cli-app-version": "^2.0.0",
Expand Down

0 comments on commit f2bc2da

Please sign in to comment.