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

For same input Stdin produces different output from "-i <file.css>" #6865

Closed
Xeevis opened this issue Jan 3, 2022 · 2 comments · Fixed by #6876
Closed

For same input Stdin produces different output from "-i <file.css>" #6865

Xeevis opened this issue Jan 3, 2022 · 2 comments · Fixed by #6876

Comments

@Xeevis
Copy link

Xeevis commented Jan 3, 2022

What version of Tailwind CSS are you using?

v3.0.9

What build tool (or framework if it abstracts the build tool) are you using?

Standalone CLI

What operating system are you using?

Windows 10

Describe your issue

When input is piped from stdin, output will not include any custom classes and layers as it does with -i <file.css.

Reproduction

  1. Download latest tailwindcss-windows-x64.exe
  2. Run PS> echo '@tailwind base;@tailwind components;@tailwind utilities;.foo{@apply bg-gray-200;}' > input.css
  3. Run PS> .\tailwindcss-windows-x64 -i input.css -o output.css
  4. Run PS> cat input.css | .\tailwindcss-windows-x64 -o output-stdin.css
  5. output.css will have .foo class appended to the end while output-stdin.css not.
@RobinMalfait
Copy link
Contributor

RobinMalfait commented Jan 4, 2022

Hey! Thank you for your suggestion!
Much appreciated! 🙏

This should be fixed, and will be available in the next release (probably later today).

The only difference is that you have to use -i - instead of no input flag at all. The reason for this is because of the halting problem. This -i - will tell the CLI to use the stdin instead of a file.

More info on this can be found in the PR: #6876

@Xeevis
Copy link
Author

Xeevis commented Jan 4, 2022

@RobinMalfait That was fast and seems to be working great, awesome! Thank you very much, you have saved me and surely many others lots of unnecessary fs i/o.

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

Successfully merging a pull request may close this issue.

2 participants