我的项目使用craco启动/构建,我希望集成顺风postcss。我遵循了这个教程https://dev.to/ryandunn/how-to-use-tailwind-with-create-react-app-and-postcss-with-no-hassle-2i09,但结果是,我遇到了这个错误:

我的配置文件如下所示:
craco.config.js (这个看起来就是问题所在,因为我觉得这个风格可能会覆盖下面的craco风格,所以它导致了上面的错误,但不是100%确定如何解决这个问题。)
module.exports = {
style: {
postcss: {
plugins: [
require("tailwindcss")("./tailwind.config.js"),
require("postcss-nested"),
require("autoprefixer"),
],
},
},

postcss.config.js
const tailwindcss = require('tailwindcss');
module.exports = {
plugins: [
tailwindcss('./tailwind.js'),
require('autoprefixer')
],
};tailwind.config.js
module.exports = {
purge: ["./src/**/*.html", "./src/**/*.jsx", "./src/**/*.js", "./src/**/*.tx", "./src/**/*.tsx"],
theme: {
extend: {
screens: {
xs: { max: "400px" },
},
},
},
};我正在从运行应用程序
docker-compose up有什么建议来修复这个错误和配置吗?请提前告知一些代码示例,谢谢!
发布于 2020-12-04 16:45:54
你需要卸载tailwindcss postcss和autoprefixer。然后用这些特定的版本重新安装它们
npm install tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9我也有同样的问题!此链接中有更多信息。https://tailwindcss.com/docs/installation#post-css-7-compatibility-build
https://stackoverflow.com/questions/64485516
复制相似问题