Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JIT] mode Tailwind CLI cannot build files in real time. #5753

Closed
ouweiya opened this issue Oct 10, 2021 · 0 comments
Closed

[JIT] mode Tailwind CLI cannot build files in real time. #5753

ouweiya opened this issue Oct 10, 2021 · 0 comments

Comments

@ouweiya
Copy link

ouweiya commented Oct 10, 2021

What version of Tailwind CSS are you using?
"tailwindcss": "^2.2.16"

What build tool (or framework if it abstracts the build tool) are you using?
Tailwind CLI v2.2.16,

What version of Node.js are you using?
v14.17.6

What browser are you using?
Chrome

What operating system are you using?
Windows 11

Describe your issue
I used Tailwind CLI to build the file and found a weird problem. I can't tell whether it was a mistake in my operation or a program error.

When I use npx tailwindcss -w, I can output the code correctly in the terminal,
But when using npx tailwindcss -o ./dist/tailwind.css --watch to output to a file in real time, the code will not be updated, it will only be executed once when the command is entered.

tailwind.config.js

module.exports = {
  mode: 'jit',
  purge: ['./index.html'],
  darkMode: false,
  theme: {
    extend: {},
  },
  variants: {
    extend: {},
  },
  plugins: [],
};

Command Line

npx tailwindcss -o ./dist/tailwind.css --watch

Dependent information

"devDependencies": {
    "autoprefixer": "^10.3.7",
    "postcss": "^8.3.9",
    "tailwindcss": "^2.2.16"
  }

index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="#" />
    <link href="./dist/tailwind.css" rel="stylesheet" />
  </head>
  <body>
    <div class="bg-red-300"></div>
  </body>
</html>
@ouweiya ouweiya changed the title JIT mode Tailwind CLI cannot build files in real time. [JIT] mode Tailwind CLI cannot build files in real time. Oct 10, 2021
@ouweiya ouweiya closed this as completed Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant