0

I think this should be possible, though dont know, I use tools like 'gulp' and 'webpack' to bundle asset files but is there any tool that extracts the necessary css classes, only that are being used, from the css files and pack them.

Ramesh Pareek
  • 1,601
  • 3
  • 30
  • 55

3 Answers3

2

What you are looking for is called tree shaking, and usually it's already done in the build process with webpack,

You can install this plugin for css specific tree shaking or you can look for more info here about how it works with javascript (something similar happens in css)

Alejandro Vales
  • 2,816
  • 22
  • 41
0

In Gulp there is package called Uncss

https://github.com/ben-eb/gulp-uncss

and also an addon that is available for firefox

https://addons.mozilla.org/en-US/firefox/addon/dust-me-selectors/

which will help you in removed unused css

yasarui
  • 6,209
  • 8
  • 41
  • 75
0

Take a look into tree shaking, there are several that are for specific css.