-
Notifications
You must be signed in to change notification settings - Fork 15
Change PPX to look at index.css
instead of tailwind.css
by default
#62
Comments
At the moment, I'm of the opinion that the PPX should instead be given the path to the @zth Do you have any initial ideas of how this feature could be implemented? Thanks in advance! |
Hey, sorry if I'm missing something, but isn't this already the behavior when using the generator feature in bsconfig + specify |
@azkane So you're correct in that it will essentially be the same behavior, though my idea was that this feature will complement having the generator in your bsconfig. Let me try to explain explain (though I may be wrong b/c I recently learned about generators!). Most people, and any production applications, will likely be using PostCSS in tandem with Tailwind. This solves a few issues, but most importantly it means you don't necessarily have to commit your I have the opinion that by default, we should be encouraging people to use PostCSS instead of using the Tailwind CLI directly: this is why I think having the Finally, it seems to me that having the generator rule in your bsconfig is great for when your working in dev mode locally, so having both the generator defined and PostCSS is the best combination. Please let me know your thoughts, and if I missed something 😄 |
@dylanirlbeck my initial idea, that isn't that thought through yet, is to have the PPX call the Tailwind CLI itself using the Calling the Tailwind CLI could either by done by running Cache invalidation could be handled by hashing the contents of There's a few potential issues:
The main benefits are:
These are my initial thoughts, although they might all be wrong as usual ;) |
Hey! I've been giving it some thought and experimenting with the demo project. I've found that configuring generators with postcss covers mostly all the points you both guys raised. No need to commit the final build file, by defining a generator step that runs Since the index.css/main.css (file where the tailwind rules are applied) is specified in the generator definition, BS will set a watcher on it when running with The downside of this approach is that the first time BS runs the build, it does the generators last, so on the first run tailwind-ppx is unable to find the tailwind.css file. The build watcher keeps running and upon doing As the configuration for the tailwind build is defined in postcss.config.js and tailwind.config.js any bundler should be able to pick it up for a production build without much issue. The speed of rebuilding the css is bound to project size/rules/etc, but on the demo project on my machine it takes about 2s every time I modify I'm not saying this is the only path to achieve these goals, I'm just trying to show how can these be achieved with whats already available. The demo project with those changes is here |
@zth @azkane What do you both think about the PPX having two different "configurations" by passing in certain parameters. Let me explain: Use 1: Passing in a Use 2: Passing in a Does having these options make sense? Please give me your thoughts! |
Per some good comments on my call for features, we should modify the PPX to instead look at the file where the Tailwind code is included (i.e. wherever the user puts
@import tailwindcss/...
).This feature could either be a configuration or be the default behavior --- this issue can serve as the discussion for what the implementation would look like.
The text was updated successfully, but these errors were encountered: