2.0.0 • Published 9 months ago
@putout/plugin-postcss v2.0.0
@putout/plugin-postcss 
postcss plugin helps to migrate to latest postcss version according to migration guide.
Install
npm i @putout/plugin-postcss -DRules
{
"rules": {
"postcss/replace-loader-with-creator": "on"
}
}replace-loader-with-creator
❌ Example of incorrect code
module.exports = postcss.plugin('postcss-dark-theme-class', (opts = {}) => {
checkOpts(opts);
return (root, result) => {
root.walkAtRules((atrule) => {});
};
});✅ Example of correct code
module.exports = (opts = {}) => {
checkOpts(opts);
return {
postcssPlugin: 'postcss-dark-theme-class',
Once(root) {
root.walkAtRules((atrule) => {});
},
};
};
module.exports.postcss = true;License
MIT