leptos-rs / start-axum-workspace

The Unlicense
48 stars 15 forks source link

Autogenerated 'tailwind.config.js' isn't compatible with workspace paths #23

Open tonky opened 6 months ago

tonky commented 6 months ago

Hi, and thanks for the Leptos - learning it and enjoying the rust full-stack idea!

So i went with start-axum-workspace template, added tailwind-input-file = "style/tailwind.css" to workspace Cargo.toml and then spent some debugging and wondering why no styles from app/src/lib.rs are in the output css, when main.scss and tailwind.css are clearly being processed.

I don't have much experience with Tailwind and its configuration file, which certainly added to my confusion.

Took me a while to realize that a ./src/**/*.rs path in module.exports.content.files in 'tailwind.config.js' won't actually process any Rust files, since we're in a workspace without ./src dir. After changing it to ./app/src/**/*.rs - everything works as intended now.

So the question is - should this be fixed, and if so - what would the fix be:

I can try and add PR, but this needs feedback with decision, and maybe some guidance.

beemdvp commented 6 months ago

Just came across this, thanks for flagging this haha. I felt like I would spend hours thinking what I did wrong

benwis commented 4 months ago

The tailwind cli isn't autogenerated, it's a static file in the start-axum-workspace template. So I'll move this issue there. A PR to fix this would be most welcome

gbj commented 3 months ago

@benwis There's no tailwind.config.js in this repo, looks like Tailwind config is generated by cargo-leptos here.

Editing to add: I'd suggest that just adding /*/src/**/*.rs to the list should cover most workspace cases but there may be a better solution.