tailwindcss in watch mode doesn't refresh outupt when files are changed using vim
See original GitHub issueThis is based on #7679 - the versions being used are listed there.
I ended up setting up test-case project here: https://github.com/javornikolov/tailwindcss-issue-7679
There is Github Actions CI job which outlines the changes I do to reproduce the issue. However the issue does’t occur when running the automated scripts. It occurs when I manually edit the file using vim
editor (doing the same changes).
vim
version is 8.2
- The issue is not observed If I copy/paste files from
template/*
to src. - The issue is (usually) not observed if I use other text editor -
gedit
. Or if I also touch files (usingtouch -m
). (Sometimes touch doesn’t help either - that’s more subtle, I am not sure how to consistently reproduce yet.)
Sometimes refresh of output.css happens when I use vim
too but it’s quite rare (and is after some modifications of file outside of vim as well).
Steps to reproduce - based on the GithHub repo above:
- start tailwindcss --watch (e.g. via
npx pm2 start ecosystem.config.js
) - Modify
src/tailwind.css
copy-pasting the content oftemplates/tailwind.css.2
usingvim
. - Similarly modify
src/index.html
(using index.html.2) - What happens is that in output.css I only have
btn-cool-1
but notbtn-cool-2
. I uploaded the state of the files to branchtopic/after-change-using-vim
in the same github repo. I included somestat
outputs in case that matters.
If I switch the order of modifying tailwind.css
and index.html
and I edit index.html
first - then nor btn-cool-1
, nor btn-cool-2
are included
Hypothesys
I suspect that the way vim
saves files has specifics which are not yet recognized as changes to source files. Perhaps it can be reproduced outside vim, I am just not fully aware in what exactly way yet. Some insights might be possibly found e.g. here: https://vi.stackexchange.com/questions/25030/vim-not-firing-inotify-events-when-writing-file
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:28 (2 by maintainers)
Hey! Have you tried to set
:set backupcopy=yes
as mentioned in your Stack Exchange link? It seems like that should solve your issue.@carderne I merged in another fix. It appears to work for me on Linux. Would you mind giving the insiders build a test?
npm install tailwindcss@insiders