Skip to content

Commit

Permalink
fix(app): fixed bootstrap css being imported rather than compass boot…
Browse files Browse the repository at this point in the history
…strap

bower-install and wiredep will now exclude bootstrap dependencies if compass bootstrap is selected, because bootstrap is imported in the main.scss file. This is to prevent a double inclusion of bootstrap.css
  • Loading branch information
DaftMonk committed Jan 17, 2014
1 parent 9950682 commit f273998
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
34 changes: 17 additions & 17 deletions app/index.js
Expand Up @@ -445,26 +445,26 @@ Generator.prototype._injectDependencies = function _injectDependencies() {
'\n' +
chalk.yellow.bold('\n grunt bower-install');

var wireDepConfig = {
directory: 'app/bower_components',
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
ignorePath: 'app/',
htmlFile: 'app/views/index.html',
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
};

if (this.jade) {
wireDepConfig.htmlFile = 'app/views/index.jade';
}

if (this.compass && this.bootstrap) {
wireDepConfig.exclude = ['sass-bootstrap'];
}

if (this.options['skip-install']) {
console.log(howToInstall);
} else {
if (this.jade) {
wiredep({
directory: 'app/bower_components',
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
ignorePath: 'app/',
htmlFile: 'app/views/index.jade',
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
});
} else {
wiredep({
directory: 'app/bower_components',
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
ignorePath: 'app/',
htmlFile: 'app/views/index.html',
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
});
}
wiredep(wireDepConfig);
}
};

Expand Down
2 changes: 2 additions & 0 deletions app/templates/styles/main.scss
@@ -1,5 +1,7 @@
<% if (compassBootstrap) { %>$icon-font-path: "/bower_components/sass-bootstrap/fonts/";

@import 'sass-bootstrap/lib/bootstrap';

<% } %>.browsehappy {
margin: 0.2em 0;
background: #ccc;
Expand Down
3 changes: 2 additions & 1 deletion templates/common/Gruntfile.js
Expand Up @@ -171,7 +171,8 @@ module.exports = function (grunt) {
app: {<% if (jade) { %>
html: '<%%= yeoman.app %>/views/index.jade',<% } else { %>
html: '<%%= yeoman.app %>/views/index.html',<% } %>
ignorePath: '<%%= yeoman.app %>/'
ignorePath: '<%%= yeoman.app %>/'<% if (compass && bootstrap) { %>,
exclude: ['sass-bootstrap']<% } %>
}
},<% if (coffee) { %>

Expand Down

0 comments on commit f273998

Please sign in to comment.