v2.tailwindcss.com/docs/guides… 官网配置方式
可能遇到的问题 ,官网默认提供的是postcss7的版本 是不支持cacro5的 ,会报错 1.UnhandledPromiseRejectionWarning: TypeError: match.loader.options.plugins is not a function 所以这里使用的是最新版的postcss npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
2.或者手动将postcss改成postcssOption github.com/facebook/cr…
下载
npx create-react-app my-project
cd my-project
引入craco
npm install @craco/craco
//剩下的默认方式则效仿官网的就可以了
引入tailwindcss加入根目录的app组件的就可以全局使用了。