Add programmatic API
MCFreddie777 opened this issue · 2 comments
MCFreddie777 commented
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
Working on it, should be available in couple of weeks
ivanblazevic commented
@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();