File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
packages/react-router-dev/vite Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import {
22
22
} from "es-module-lexer" ;
23
23
import jsesc from "jsesc" ;
24
24
import colors from "picocolors" ;
25
+ import kebabCase from "lodash/kebabCase" ;
25
26
26
27
import * as Typegen from "../typegen" ;
27
28
import { type RouteManifestEntry , type RouteManifest } from "../config/routes" ;
@@ -1024,6 +1025,21 @@ export const reactRouterVitePlugin: ReactRouterVitePlugin = () => {
1024
1025
rollupOptions : {
1025
1026
...baseRollupOptions ,
1026
1027
preserveEntrySignatures : "exports-only" ,
1028
+ output : {
1029
+ entryFileNames ( { moduleIds } ) {
1030
+ let routeChunkModuleId =
1031
+ moduleIds . find ( isRouteChunkModuleId ) ;
1032
+ let routeChunkName = routeChunkModuleId
1033
+ ? getRouteChunkNameFromModuleId (
1034
+ routeChunkModuleId
1035
+ )
1036
+ : null ;
1037
+ let routeChunkSuffix = routeChunkName
1038
+ ? `-${ kebabCase ( routeChunkName ) } `
1039
+ : "" ;
1040
+ return `assets/[name]${ routeChunkSuffix } -[hash].js` ;
1041
+ } ,
1042
+ } ,
1027
1043
input : [
1028
1044
ctx . entryClientFilePath ,
1029
1045
...Object . values (
You can’t perform that action at this time.
0 commit comments