File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
packages/react-router-dev/vite Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @react-router/dev " : patch
3
+ ---
4
+
5
+ [ UNSTABLE] Normalize dirent entry path across node versions when generating SRI manifest
Original file line number Diff line number Diff line change 267
267
- parveen232
268
268
- paulsmithkc
269
269
- pavsoldatov
270
+ - pawelblaszczyk5
270
271
- pcattori
271
272
- penx
272
273
- petersendidit
Original file line number Diff line number Diff line change @@ -810,10 +810,15 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
810
810
let sriManifest : ReactRouterManifest [ "sri" ] = { } ;
811
811
for ( const entry of entries ) {
812
812
if ( entry . isFile ( ) && entry . name . endsWith ( ".js" ) ) {
813
+ const entryNormalizedPath =
814
+ "parentPath" in entry && typeof entry . parentPath === "string"
815
+ ? entry . parentPath
816
+ : entry . path ;
817
+
813
818
let contents ;
814
819
try {
815
820
contents = await fse . readFile (
816
- path . join ( entry . path , entry . name ) ,
821
+ path . join ( entryNormalizedPath , entry . name ) ,
817
822
"utf-8"
818
823
) ;
819
824
} catch ( e ) {
@@ -825,7 +830,7 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
825
830
. digest ( )
826
831
. toString ( "base64" ) ;
827
832
let filepath = getVite ( ) . normalizePath (
828
- path . relative ( clientBuildDirectory , path . join ( entry . path , entry . name ) )
833
+ path . relative ( clientBuildDirectory , path . join ( entryNormalizedPath , entry . name ) )
829
834
) ;
830
835
sriManifest [ `${ ctx . publicPath } ${ filepath } ` ] = `sha384-${ hash } ` ;
831
836
}
You can’t perform that action at this time.
0 commit comments