abishekatp / stylers

Fully compile time scoped CSS for Leptos components
MIT License
139 stars 13 forks source link

1.0.0-alpha breaks `style_sheet` in workspaces #50

Open Xendergo opened 1 year ago

Xendergo commented 1 year ago

If you have a directory structure like this:

workspace
|- *other workspace members*
|- frontend
   |- build.rs
   |- *source code*

style_sheet!(...) will base files paths from workspace but the build function in build.rs bases file paths from workspace/frontend.

My workaround is to change my build.rs to this:

use stylers::build;

fn main() {
    std::env::set_current_dir("..").unwrap();
    build(Some(String::from("./target/main.css")));
}

To reproduce: bug-testing.zip

abishekatp commented 1 year ago

Hi, Thank you for opening an issue. I checked your code and got the problem.

If you get some idea please suggest it( I will also think about possible solutions for this problem). Till then we can use the workaround you have found.