Following the theming page of the Bootstrap documentation, I can successfully compile a custom.scss
file into CSS in my NPM project which follows the recommended file structure:
my-project/
├── scss
│ └── custom.scss
└── node_modules/
└── bootstrap
├── js
└── scss
However, I am not satisfied with this CSS output; I would like to leverage additional tools that Bootstrap uses, such as autoprefixer and minifier. For example, my custom.scss
would compile then output both custom.css
and custom.min.css
files—just as would be done by running npm run css-minify-main
within the Bootstrap source folder. Bootstrap's build tools documentation page even describes how to do that, but it says nothing about integrating custom SCSS into this process.
As a potential workaround, installing all of the same devDependencies
and copying the scripts
from bootstrap/package.json into my project would not only be redundant. It would require active maintenance (e.g. if the source were updated by npm, or even tracking the Git repo, etc) in order to ensure that all versions are up-to-date, to check whether deps have been added/removed, and so on. So, is there a way to run those exact scripts from within my-project/
instead of the my-project/node_modules/bootstrap/
source folder?