找了半天各种方案,配置感觉各种问题,找了一下,竟然发现有人写了一个vuecli的插件

vue add tailwind

然后选择一个选项即可

none - 不创建初始的配置文件
minimal (默认) - 将会创建一个简易的配置文件,具体的配置项可以去官网查
full - 创建一个包含一些默认配置的配置文件

默认会在根目录创建

postcss.config.js

tailwind.config.js

package.json会默认装上以下依赖


 "@tailwindcss/postcss7-compat": "^2.0.2",
 "autoprefixer": "^9",
 "postcss": "^7",
 "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
 "vue-cli-plugin-tailwind": "~2.0.5",
Last modification:February 5th, 2021 at 11:40 pm
If you think my article is useful to you, please feel free to appreciate