[Vuejs]-When installing Tailwind CSS in Vue 3, do I need a postcss.config.js file?

3πŸ‘

βœ…

No, "postcss": "^8.3.6" in the package.json file is not the "postcss key" mentioned in the docs – it’s the version specifier for the postcss dependency.

The "postcss key in your package.json file" refers to a postcss root property in the JSON:

// package.json
{
  "name": "my-project",
  "version": "0.1.0",
  "dependencies": {
    /*...*/
  }, πŸ‘‡
  "postcss": {
    "plugins": {
      "tailwindcss": {},
      "autoprefixer": {},
    }
  }
}

If you prefer not to store the config in package.json, you could use one of the other possible locations where the PostCSS config is read, including postcss.config.js. However, you don’t need more than one PostCSS config file (e.g., postcss.config.js in addition to the postcss key in package.json).

πŸ‘€tony19

Leave a comment