Skip to content

Commit b3ad2a2

Browse files
Fix support for custom build.assetsDir (#13077)
1 parent 21aff33 commit b3ad2a2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/gold-insects-remain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Fix support for custom `build.assetsDir`

packages/react-router-dev/vite/plugin.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3248,7 +3248,10 @@ export async function getEnvironmentOptionsResolvers(
32483248
let routeChunkSuffix = routeChunkName
32493249
? `-${kebabCase(routeChunkName)}`
32503250
: "";
3251-
return `assets/[name]${routeChunkSuffix}-[hash].js`;
3251+
return path.posix.join(
3252+
viteUserConfig.build?.assetsDir ?? "assets",
3253+
`[name]${routeChunkSuffix}-[hash].js`
3254+
);
32523255
},
32533256
},
32543257
},

0 commit comments

Comments
 (0)