Based on Shane's answer , I did it as follows:
- copy
node_modules/bootstrap/less/bootstrap.less to boostrap-custom.less - put this file in the source tree, for example
src/style/bootstrap-custom.less - in the file, create a variable pointing to the
less source files that are under node_modules ), and find / replace all existing @import directives to indicate the correct path (see example below). Adjust as needed. require / import this file, if necessary: import './style/bootstrap-custom.less';
Example (adapt relative path, comment out unwanted modules, make settings, etc.):
/* Custom Bootstrap composer */ @BS: "../../node_modules/bootstrap/less"; // Core variables and mixins @import "@{BS}/variables.less"; @import "@{BS}/mixins.less"; // Reset and dependencies @import "@{BS}/normalize.less"; @import "@{BS}/print.less"; // Disabling glyphicons for [reasons] //@import "@{BS}/glyphicons.less"; [...]
Variable interpolation in @import was implemented in Meneghi 1.4.0 , so it should be supported everywhere now.
This is to survive (minor) updates for bootstrapping. Of course, if they greatly alter the main .less file, you may need to adapt or redo it.
source share