abyrne85
abyrne85

Reputation: 1460

Tree shaking bootstrap css for specific angular bootstrap modules

Is it possible to specify the css rules for only the angular-bootstrap modules that I'm using in my application? For example I'm only using the dropdown, datepicker and tooltip modules from angular bootstrap. However the entire bootstrap css file is required for these three modules. I'm not using bootstraps css in the rest of my application so I think importing the entire css file is overkill.

Upvotes: 1

Views: 1138

Answers (1)

major sam
major sam

Reputation: 580

Webpack has a built in treeshaking function, which will be the easiest option if your project is already done or way ahead in development.

I have also found this treeshaking that manually compiles Bootstrap and uses Gulp to do the treeshaking in the mean time. I found it to be way harder and possibly outputing the same result, but make yourself comfortable.

Upvotes: 2

Related Questions