Closed tsnobip closed 4 years ago
@tsnobip Just because I'm curious -- can you try removing the generator config and see what happens? I feel like I came across this a long time ago..
Oh interesting, I'll check it out and let you know :)
no @dylanirlbeck, unfortunately I get the same error when I remove the generators 😞
@dylanirlbeck I looked for a minimal repro and actually just cloning https://github.com/dylanirlbeck/my-first-pr/ and doing bsb -clean-world
will reproduce the same error at next build since it erases tailwind.css
. So definitely not related to monorepo.
@tsnobip So I think this behavior is in fact due to how BuckleScript generators work, and thus is not a bug with tailwind-ppx
(I may still be wrong, but this is my guess). In short, the generator automatically deletes the $out
file when you run bsb -clean-world
, and in this case that $out
file is tailwind.css
.
I can try and improve the docs and/or investigate the process to see if tailwind-ppx
can consume tailwind.css
in a smarter way with the generator in mind, but for now I'm going to close this issue since I don't think it's related to tailwind-ppx
.
That said, I'm happy to re-open at any time if this turns out to be a tailwind-ppx
issue.
oh OK @dylanirlbeck, I'm not really sure how to make it work without the generator though, you do need a tailwind.css
to be generated somehow and it shouldn't be versioned, so what's the regular process?
@tsnobip The generator is just an automated way to run the Tailwind CLI!
If the generator was working properly, you should already have the tailwind-css
NPM package installed in your project. Thus, all you need to do is to manually generated the tailwind.css
file whenever you change index.css
, which can be done with something that looks like the following command (this is pulled right from the generator docs):
tailwindcss build index.css -o tailwind.css -c ../../tailwind.config.js
You might need an npx tailwindcss ...
, but hopefully the package gets put in your PATH
by default.
Let me know if you have any other questions!
works perfectly thank you, I feel a bit dumb now ^^ Maybe the use of generators should document this caveat though, when I have some time I'll try to see if the generator can be triggered before the build so it doesn't create this situation anymore.
Awesome! Yeah if you have any insights please let me know, I'd love to change our docs if there is a better way to do this.
After cleaning up, my first build systematically fails with:
then it builds
index.css
and the following incremental builds work correctly. I also use a very simple monorepo setup with yarn, might be related.My bsconfig.json is as follows:
Any idea why this happens?