vue-component-compiler
vue-component-compiler copied to clipboard
PostCSS 8 deprecates `postcss.plugin`
I’m running with rollup-plugin-vue and vue-component-compiler provides a plugin, postcss-clean that causes this message to be output:
clean: postcss.plugin was deprecated. Migration guide:
https://evilmartians.com/chronicles/postcss-8-plugin-migration
This appears to work fine for now, but the API used on postcss-clean.ts:6 is deprecated.
Since this package is unlikely to be patched, I used https://www.npmjs.com/package/patch-package to silence the warning
-exports.default = postcss.plugin('clean', (options) => {
+exports.default = (options) => {
const clean = new CleanCSS(Object.assign({ compatibility: 'ie9' }, options));
- return (css, res) => {
+ return {
+ postcssPlugin: 'clean',
+ Once(css, res) {
const output = clean.minify(css.toString());
res.root = postcss.parse(output.styles);
+ },
};
-});
+};
+exports.postcss = true