PostCSS stuck after generating output
ConsoleTVs opened this issue · 2 comments
What version of @tailwindcss/jit are you using?
0.1.6
What version of Node.js are you using?
v15.3.0
What browser are you using?
N/A
What operating system are you using?
macOS
Reproduction repository
N/A
The postcss cli never stops. I have to manually control + c to stop it. The file is correctly generated tho after a few ms.
If I use the cross-env and pass in the production flag, it does correctly stop.
postcss.config.js:
module.exports = {
plugins: {
'@tailwindcss/jit': {},
'autoprefixer': {},
},
}script to execute it:
{
"tw": "postcss ./resources/css/widget.css -o ./public/widget.css"
}> XXXX@1.0.0 tw
> postcss ./resources/css/widget.css -o ./public/widget.css
(it never stops, file is correctly generated tho)Hey! Make sure you set the TAILWIND_MODE=build env variable if you are doing a development build without a watcher.
From the README:
Make sure you set NODE_ENV=development if you are running a watcher, or Tailwind won't watch your template files for changes. Set NODE_ENV=production for one-off builds.
If you want to control whether Tailwind watches files or not more explicitly, set TAILWIND_MODE=watch or TAILWIND_MODE=build to override the default NODE_ENV-based behavior.
For example if you want to do one-off builds with NODE_ENV=development, explicitly set TAILWIND_MODE=build so that Tailwind knows you are just doing a one-off build and doesn't hang.
Thank you for the answer. I had been working too much hours and didn’t spot that, sorry for the inconvenience.