ivanblazevic / ngx-unused-css

Angular unused css detection
82 stars 16 forks source link

Add programmatic API #38

Open MCFreddie777 opened 3 years ago

MCFreddie777 commented 3 years ago

Right now, the package can be only used from the CLI with the config file. It would be nice to use it from script, that would require typescript definitions, config from parameter and returning json of files and unused classes.

ivanblazevic commented 2 years ago

Working on it, should be available in couple of weeks

ivanblazevic commented 2 years ago

@MCFreddie777 could you tryout latest pre-release version where API was exposed and let me know if that works for you ?

import { NgxUnusedCSS } from 'ngx-unused-css';

const result = new NgxUnusedCSS(config).instance.run();