简体   繁体   中英

Tailwind CSS not building

I'm currently practicing some tailwindcss frontend design. I've installed it using npm, and I didn't get any errors. I made the build script for tailwindcss. When I run the appropriate command to build the tailwindcss, it doesn't output it to the style.css file I set as the output file. I also don't get any errors. This is my code for the package.json file:

{
  "name": "design",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build:css": "tailwindcss build src/style.css -o dist/style.css"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "tailwindcss": "^1.3.4"
  }
}

You seem to be missing npx in your command, try this instead:

npx tailwindcss build src/style.css -o dist/style.css

https://tailwindcss.com/docs/installation/#4-process-your-css-with-tailwind

The correct way to add scripts:-

"build": "npx tailwindcss build src/style.css -o dist/style.css"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM