Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwindcss doesn't load in prod. #897

Open
RedIsGaming opened this issue Oct 26, 2024 · 3 comments
Open

Tailwindcss doesn't load in prod. #897

RedIsGaming opened this issue Oct 26, 2024 · 3 comments

Comments

@RedIsGaming
Copy link

When developing in dev mode with Leptos and tailwindcss, using the right settings and link attributes works, but when shipping it to prod, it doesn't load. The problem is in the dist folder the type is unknown. It doesn't know from which type is it: text/css, so it doesn't parse. The solution is to create in the index.html a href to a custom created tailwind.css from the tailwind attributes the 3 also listed on the website and put it in dist. As long as the path in dist match the path from the css there it doesn't matter if in main the index.html path doesn't work, because you can safely rely on data-trunk for it.

Its just something I got fixed this way. Hopefully you can fix it for features releases!

@ctron
Copy link
Collaborator

ctron commented Oct 28, 2024

I am not sure I understand. Is there a simple reproducer? With some expected vs actual index.html that you could provide.

@RedIsGaming
Copy link
Author

With npx you can put the input to the dist folder and compile that. Then you call in index.html the link to this, but trunk doesn't do this

@ctron
Copy link
Collaborator

ctron commented Nov 5, 2024

The dist folder should only contain the build output. There's an intermediate build folder. But I understand too little about it to be able to help.

Maybe it makes sense to create a reproducer, as an example in trunk, showing how it works, and figuring out what needs to be done. A PR might help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants