Skip to content

Commit f273998

Browse files
committed
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
1 parent 9950682 commit f273998

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

Diff for: app/index.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -445,26 +445,26 @@ Generator.prototype._injectDependencies = function _injectDependencies() {
445445
'\n' +
446446
chalk.yellow.bold('\n grunt bower-install');
447447

448+
var wireDepConfig = {
449+
directory: 'app/bower_components',
450+
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
451+
ignorePath: 'app/',
452+
htmlFile: 'app/views/index.html',
453+
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
454+
};
455+
456+
if (this.jade) {
457+
wireDepConfig.htmlFile = 'app/views/index.jade';
458+
}
459+
460+
if (this.compass && this.bootstrap) {
461+
wireDepConfig.exclude = ['sass-bootstrap'];
462+
}
463+
448464
if (this.options['skip-install']) {
449465
console.log(howToInstall);
450466
} else {
451-
if (this.jade) {
452-
wiredep({
453-
directory: 'app/bower_components',
454-
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
455-
ignorePath: 'app/',
456-
htmlFile: 'app/views/index.jade',
457-
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
458-
});
459-
} else {
460-
wiredep({
461-
directory: 'app/bower_components',
462-
bowerJson: JSON.parse(fs.readFileSync('./bower.json')),
463-
ignorePath: 'app/',
464-
htmlFile: 'app/views/index.html',
465-
cssPattern: '<link rel="stylesheet" href="{{filePath}}">'
466-
});
467-
}
467+
wiredep(wireDepConfig);
468468
}
469469
};
470470

Diff for: app/templates/styles/main.scss

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<% if (compassBootstrap) { %>$icon-font-path: "/bower_components/sass-bootstrap/fonts/";
22

3+
@import 'sass-bootstrap/lib/bootstrap';
4+
35
<% } %>.browsehappy {
46
margin: 0.2em 0;
57
background: #ccc;

Diff for: templates/common/Gruntfile.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ module.exports = function (grunt) {
171171
app: {<% if (jade) { %>
172172
html: '<%%= yeoman.app %>/views/index.jade',<% } else { %>
173173
html: '<%%= yeoman.app %>/views/index.html',<% } %>
174-
ignorePath: '<%%= yeoman.app %>/'
174+
ignorePath: '<%%= yeoman.app %>/'<% if (compass && bootstrap) { %>,
175+
exclude: ['sass-bootstrap']<% } %>
175176
}
176177
},<% if (coffee) { %>
177178

0 commit comments

Comments
 (0)