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

Optimize wasm bindgen asset with manganis #3531

Merged
merged 20 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into optimize-initial-assets
  • Loading branch information
ealmloff authored Jan 17, 2025
commit 15040b328c64fbf86ec83ed6a42ae81d53f46f3c
11 changes: 7 additions & 4 deletions packages/cli/src/build/web.rs
Original file line number Diff line number Diff line change
@@ -211,10 +211,13 @@ impl AppBundle {
// If the path is absolute, make it relative to the current directory before we join it
// The path is actually a web path which is relative to the root of the website
let path = path.strip_prefix("/").unwrap_or(path);
let asset_dir_path = self.build.krate.legacy_asset_dir().join(path);
if let Ok(absolute_path) = asset_dir_path.canonicalize() {
let absolute_crate_root =
self.build.krate.crate_dir().canonicalize().unwrap();
let asset_dir_path = self
.krate
.legacy_asset_dir()
.map(|dir| dir.join(path).canonicalize());

if let Some(Ok(absolute_path)) = asset_dir_path {
let absolute_crate_root = self.krate.crate_dir().canonicalize().unwrap();
PathBuf::from("./")
.join(absolute_path.strip_prefix(absolute_crate_root).unwrap())
} else {
You are viewing a condensed version of this merge commit. You can view the full changes here.