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

1.0.0-alpha breaks style_sheet in workspaces #50

Open
Xendergo opened this issue Oct 14, 2023 · 1 comment
Open

1.0.0-alpha breaks style_sheet in workspaces #50

Xendergo opened this issue Oct 14, 2023 · 1 comment

Comments

@Xendergo
Copy link

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
Copy link
Owner

abishekatp commented Oct 15, 2023

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

  • So the problem is when we are at workspace. the build script the path is based on the workspace member itself(since build.rs corresponds to that workspace member). But the macro uses the workspace root path.

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.

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