phoenixframework / tailwind

An installer for tailwind
MIT License
467 stars 61 forks source link

Don't generate assets files when running install_and_run #53

Closed danschultzer closed 1 year ago

danschultzer commented 1 year ago

This resolves an issue of assets being generated when watcher is running.

In our use case we saw assets files being generated whenever we span up the app in local from scratch. This is because the watcher runs Tailwind.install_and_run/2 that will not only install tailwind but also touch asset files if tailwind doesn't exist. This is a problem in umbrella apps, and any apps that deviates from the default phoenix css/js setup as discussed in #33.

I don't believe the intention is to write assets file if you don't explicitly use tailwind.install mix task so I've removed that step from Tailwind.install_and_run/2.

danschultzer commented 1 year ago

I kinda want to change naming to Tailwind.install_tailwind_and_run/2 instead or maybe call two separate functions in the tailwind install mix task. This PR was just to make the most minimal change to API.

danschultzer commented 1 year ago

Pushed a second commit that separates tailwind install and writing to files in assets. I think this is better, but wdyt @chrismccord? Any reason to also write to files when running the watcher?

josevalim commented 1 year ago

I added it as --no-assets :)