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

fix(cli): Updated logic to resolve out_dir paths relative to workspace #3393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nathy-bajo
Copy link

This fix ensures the out_dir configuration in Dioxus.toml is respected for web builds, allowing users to specify custom output directories. Key updates include:

  • Added out_dir handling to resolve both relative and absolute paths.
  • Ensured the directory is created if missing, with error logging.
  • Introduced an out_dir field in ApplicationConfig (default: "dist") and integrated it into DioxusConfig for backward compatibility.
    Users can now customize the build output directory seamlessly.

@richard-viney
Copy link

The code looks reasonable to me. Is it based on what was present in 0.5?

@Nathy-bajo
Copy link
Author

The code looks reasonable to me. Is it based on what was present in 0.5?

No, I noticed the issue, thought of a solution, and then tried implementing it to fix the problem.

@richard-viney
Copy link

richard-viney commented Dec 19, 2024

All good, I was just curious how it ended up being lost in the new version.

Is it possible to add a unit test for this functionality?

@Nathy-bajo
Copy link
Author

All good, I was just curious how it ended up being lost in the new version.

Is it possible to add a unit test for this functionality?

Yes!

@jkelleyrtp
Copy link
Member

We dropped outdir as the primary build dir in 0.6 since that was causing lots of bugs on its own with multiple profiles/platforms/projects/etc.

To properly isolate builds from each other, dx needs to be somewhat opaque with its output structure.

You can use dx bundle --json-output and some jq to parse the output which might be better for automation cases.

Given how many folks rely on outdir, I think we should keep it though. However, my vote is to only have an outdir in release mode/bundle and/or make it a cli argument only.

dx now uses the build_dir for lots of stuff - not only emitting a /public dir and a server.

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

Successfully merging this pull request may close these issues.

3 participants