ivanblazevic/ngx-unused-css

[feat] auto remove unused styles

dylanvdmerwe opened this issue · 1 comments

Would it be possible through a parameter for ngx-unused-css to remove all styles it deems as unused automatically?

The use case would be in an existing project with lots and lots of style sheets. You can run the command that will touch the files. And then each modified file can be tested and compared (git) to see what the impact is.

@dylanvdmerwe how we would handle case when there is import file in styling and there are some variables used in the styling from that import file? As you see, we always need to compile entire SCSS (including all relevant imports) and provide output (CSS) to PurgeCSS library - after it is compiled, we can get the results without unused classes, but thing is that the result is CSS > so it would mean that we would need to do reverse engineering to decompile CSS into SCSS and turn it back. I haven't found any existing lib which does purging on scss/sass/less - any ideas how we could make this feature functional?