Skip to content

Commit

Permalink
select the right zepto bower repo and exclude jquery
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiip committed Jul 14, 2015
1 parent 6e55985 commit a29a790
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/bower.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = function(GulpAngularGenerator) {
*/
GulpAngularGenerator.prototype.computeWiredepExclusions = function computeWiredepExclusions() {
this.wiredepExclusions = [];
if (this.props.jQuery.key === 'none') {
if (this.props.jQuery.key === 'none' || this.props.jQuery.key === 'zepto') {
this.wiredepExclusions.push('/jquery/');
}
if (this.props.ui.key === 'bootstrap') {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/_bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<% } if (props.jQuery.key === 'jquery2') { -%>
"jquery": "~2.1.4",
<% } if (props.jQuery.key === 'zepto') { -%>
"zeptojs": "~1.1.6",
"zepto": "~1.1.6",
<% } if (props.resource.key === 'angular-resource') { -%>
"angular-resource": "<%- props.angularVersion %>",
<% } if (props.resource.key === 'restangular') { -%>
Expand Down
11 changes: 11 additions & 0 deletions test/node/test-bower.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,17 @@ describe('gulp-angular generator bower script', function () {
generator.computeWiredepExclusions();
generator.wiredepExclusions[0].should.be.equal('/jquery/');
});

it('should exclude jQuery with Zepto', function() {
generator.props = {
jQuery: { key: 'zepto' },
ui: { key: 'foundation' },
foundationComponents: { key: 'official' },
cssPreprocessor: { key: 'none' }
};
generator.computeWiredepExclusions();
generator.wiredepExclusions[0].should.be.equal('/jquery/');
});
});

});

0 comments on commit a29a790

Please sign in to comment.