Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions packages/cli/src/build/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,10 +522,13 @@ impl AppBuilder {
}

if let Some(base_path) = krate.base_path() {
envs.push((
dioxus_cli_config::ASSET_ROOT_ENV.into(),
base_path.to_string(),
));
let trimmed = base_path.trim_matches('/');
if !trimmed.is_empty() {
envs.push((
dioxus_cli_config::ASSET_ROOT_ENV.into(),
trimmed.to_string(),
));
}
}

if let Some(env_filter) = env::var_os("RUST_LOG").and_then(|e| e.into_string().ok()) {
Expand Down
10 changes: 8 additions & 2 deletions packages/cli/src/build/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2802,7 +2802,10 @@ impl BuildRequest {
// todo: should we even be doing this? might be better being a build.rs or something else.
if self.release {
if let Some(base_path) = self.base_path() {
env_vars.push((ASSET_ROOT_ENV.into(), base_path.to_string().into()));
let trimmed = base_path.trim_matches('/');
if !trimmed.is_empty() {
env_vars.push((ASSET_ROOT_ENV.into(), trimmed.to_string().into()));
}
}
env_vars.push((
APP_TITLE_ENV.into(),
Expand Down Expand Up @@ -4899,7 +4902,10 @@ __wbg_init({{module_or_path: "/{}/{wasm_path}"}}).then((wasm) => {{
// Add the base path to the head if this is a debug build
if self.is_dev_build() {
if let Some(base_path) = &self.base_path() {
head_resources.push_str(&format_base_path_meta_element(base_path));
let trimmed = base_path.trim_matches('/');
if !trimmed.is_empty() {
head_resources.push_str(&format_base_path_meta_element(trimmed));
}
}
}

Expand Down
Loading