chore(cli): split compilers
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import postcss from 'postcss';
|
||||
import postcssrc from 'postcss-load-config';
|
||||
import { POSTCSS_CONFIG_FILE } from '../common/constant';
|
||||
|
||||
export async function compileCss(source: string | Buffer) {
|
||||
const config = await postcssrc({}, POSTCSS_CONFIG_FILE);
|
||||
const output = await postcss(config.plugins as any).process(source, {
|
||||
from: undefined
|
||||
});
|
||||
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user