I read instruction PostCSS plugin Guidlines, wrote a simple plugin just for the test.
module.exports = (opts) => {
return {
postcssPlugin: "testplugin",
Once(root) {
console.log("Hello")
},
};
};
module.exports.postcss = true;
But I don't understand how I can connect it to tailwind. I know there is a postcss.config.js file is about the following content
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {}
},
};
but all my attempts to add a plugin there lead to the error
Cannot find module 'testplugin'
i use tailwind 3.1.8 and postcss 8.4.16
I wrote tailwind plugin but the question remains open