File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/react-router-dev/vite Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -810,10 +810,15 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
810810 let sriManifest : ReactRouterManifest [ "sri" ] = { } ;
811811 for ( const entry of entries ) {
812812 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+
813818 let contents ;
814819 try {
815820 contents = await fse . readFile (
816- path . join ( entry . path , entry . name ) ,
821+ path . join ( entryNormalizedPath , entry . name ) ,
817822 "utf-8"
818823 ) ;
819824 } catch ( e ) {
@@ -825,7 +830,7 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
825830 . digest ( )
826831 . toString ( "base64" ) ;
827832 let filepath = getVite ( ) . normalizePath (
828- path . relative ( clientBuildDirectory , path . join ( entry . path , entry . name ) )
833+ path . relative ( clientBuildDirectory , path . join ( entryNormalizedPath , entry . name ) )
829834 ) ;
830835 sriManifest [ `${ ctx . publicPath } ${ filepath } ` ] = `sha384-${ hash } ` ;
831836 }
You can’t perform that action at this time.
0 commit comments