- Clone this repo
- Run
npm install
- Run
npm run dev
- Open the project in your browser. Very likely at
http://localhost:5173/
Now everything is setup and you should see Generating CSS for /src/App.css
in
the terminal once.
- Open
src/App.tsx
and just save the file, nothing else. You can also usetouch ./src/App.tsx
in the terminal. - Notice how there are 2 logs:
Generating CSS for /src/App.css Generating CSS for /src/App.css
I expect to only see a single log when saving the file.
-
I used the following command to create the Vite project:
npm create vite@latest vite-double-tailwind-invocation cd vite-double-tailwind-invocation
I picked
React
for the framework, and pressedEnter
for all other options to pick the default. -
Added a basic Vite plugin directly in
vite.config.ts
that mimics the problem. Added some comments in the file to explain what is going on.