-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: apply expo-asset patch from expo/expo#24562
See: expo/expo#24562
- Loading branch information
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,5 +45,10 @@ | |
"resolutions": { | ||
"react-refresh": "~0.14.0" | ||
}, | ||
"private": true | ||
"private": true, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
diff --git a/tools/hashAssetFiles.js b/tools/hashAssetFiles.js | ||
index c118dcf1efc32b509f83df314e15de2a8ea9e1b0..c88088736a79b00645ca85d04bb9a4d936e4af47 100644 | ||
--- a/tools/hashAssetFiles.js | ||
+++ b/tools/hashAssetFiles.js | ||
@@ -15,6 +15,19 @@ module.exports = function hashAssetFiles(asset) { | ||
.replace(/\.\.\//g, '_'); | ||
} | ||
|
||
+ // URL encode asset paths defined as `?export_path` or `?unstable_path` query parameters. | ||
+ // Decoding should be done automatically when parsing the URL through Node or the browser. | ||
+ const assetPathQueryParameter = asset.httpServerLocation.match( | ||
+ /\?(export_path|unstable_path)=(.*)/ | ||
+ ); | ||
+ if (assetPathQueryParameter && assetPathQueryParameter[2]) { | ||
+ const assetPath = assetPathQueryParameter[2]; | ||
+ asset.httpServerLocation = asset.httpServerLocation.replace( | ||
+ assetPath, | ||
+ encodeURIComponent(assetPath) | ||
+ ); | ||
+ } | ||
+ | ||
return asset; | ||
}); | ||
}; |