From f27399879e84daf7230d9cd953c19e93bcd22746 Mon Sep 17 00:00:00 2001 From: Tyler Henkel Date: Fri, 17 Jan 2014 10:26:32 -0500 Subject: [PATCH] fix(app): fixed bootstrap css being imported rather than compass bootstrap 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 --- app/index.js | 34 +++++++++++++++++----------------- app/templates/styles/main.scss | 2 ++ templates/common/Gruntfile.js | 3 ++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/app/index.js b/app/index.js index f1a8f701c..7c27bba7c 100644 --- a/app/index.js +++ b/app/index.js @@ -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: '' + }; + + 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: '' - }); - } else { - wiredep({ - directory: 'app/bower_components', - bowerJson: JSON.parse(fs.readFileSync('./bower.json')), - ignorePath: 'app/', - htmlFile: 'app/views/index.html', - cssPattern: '' - }); - } + wiredep(wireDepConfig); } }; diff --git a/app/templates/styles/main.scss b/app/templates/styles/main.scss index e0c75c603..033261fe2 100644 --- a/app/templates/styles/main.scss +++ b/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; diff --git a/templates/common/Gruntfile.js b/templates/common/Gruntfile.js index 13b75c45a..ad7a93539 100644 --- a/templates/common/Gruntfile.js +++ b/templates/common/Gruntfile.js @@ -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) { %>