gruntjs - Customize Bootstrap (sass) avoiding be overrided by someone else when packages are installed via Bower -
i know best way customize bootstrap (sass) avoiding overrided else when packages installed via bower.
let's have project grunt, bower , bootstrap (sass).
in bower.json have dependencies bootstrap-sass:
{ ... "dependencies": { "bootstrap-sass": "^3.3.7", ... } }
through grunt install packages bower dependencies, downloaded in /bower_components folder. scss bootstrap files copied /bower_components/bootstrap-sass/assets/stylesheets /sass. have main.scss file in /sass wich imports bootstrap (@import 'bootstrap';). /sass/main.scss compiled /css/main.css. gruntfile.js:
module.exports = function(grunt) { grunt.initconfig({ pkg: grunt.file.readjson('package.json'), 'bower-install-simple': { prod: { options: { production: true } }, dev: { options: { production: false } } }, bowercopy: { options: { srcprefix: 'bower_components' }, sass: { options: { destprefix: 'sass' }, files: { '_bootstrap.scss': 'bootstrap-sass/assets/stylesheets/_bootstrap.scss', 'bootstrap': 'bootstrap-sass/assets/stylesheets/bootstrap/*.scss', 'bootstrap/mixins': 'bootstrap-sass/assets/stylesheets/bootstrap/mixins/*.scss' } }, ... }, sass: { dist: { files: { 'css/main.css': 'sass/main.scss', } } }, ... }); grunt.loadnpmtasks('grunt-bower-install-simple'); grunt.loadnpmtasks('grunt-bowercopy'); grunt.loadnpmtasks('grunt-contrib-sass'); ... grunt.registertask('bower', ['bower-install-simple:dev', 'bowercopy']); ... };
so want customize bootstrap. example want modify variables /sass/bootstrap/_variables.scss , remove components /sass/_bootstrap.scss. problem when else installs packages via bower , customized bootstrap overrided default one.
how keep customized bootstrap without been overrided?
Comments
Post a Comment