rsbuild-plugin-react-router 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -2
- package/dist/index.js +10 -2
- package/dist/react-router-config.d.ts +1 -0
- package/package.json +8 -8
- package/src/mode-plan.ts +10 -0
- package/src/react-router-config.ts +5 -0
package/dist/index.cjs
CHANGED
|
@@ -12305,6 +12305,7 @@ const redirectStatusCodes = new Set([
|
|
|
12305
12305
|
if (manifestPath && !manifestPath.startsWith('/')) throw Error('The `routeDiscovery.manifestPath` config must be a root-relative pathname beginning with a slash (i.e., "/__manifest")');
|
|
12306
12306
|
return userRouteDiscovery;
|
|
12307
12307
|
}, createDefaultFutureConfig = ()=>({
|
|
12308
|
+
unstable_enableNodeReadableStream: !1,
|
|
12308
12309
|
unstable_optimizeDeps: !1,
|
|
12309
12310
|
unstable_subResourceIntegrity: !1,
|
|
12310
12311
|
unstable_trailingSlashAwareDataRequests: getDefaultTrailingSlashAwareDataRequests(),
|
|
@@ -15709,11 +15710,18 @@ export {
|
|
|
15709
15710
|
library: {
|
|
15710
15711
|
type: 'module'
|
|
15711
15712
|
},
|
|
15712
|
-
module: !0
|
|
15713
|
+
module: !0,
|
|
15714
|
+
...isBuild ? {
|
|
15715
|
+
chunkFilename: 'static/js/async/[id]-[contenthash:16].js'
|
|
15716
|
+
} : {}
|
|
15713
15717
|
},
|
|
15714
15718
|
webOptimization: {
|
|
15715
15719
|
avoidEntryIife: !0,
|
|
15716
|
-
runtimeChunk: 'single'
|
|
15720
|
+
runtimeChunk: 'single',
|
|
15721
|
+
...isBuild ? {
|
|
15722
|
+
mangleExports: 'size',
|
|
15723
|
+
usedExports: 'global'
|
|
15724
|
+
} : {}
|
|
15717
15725
|
},
|
|
15718
15726
|
nodeExternals: Array.from(new Set([
|
|
15719
15727
|
'express',
|
package/dist/index.js
CHANGED
|
@@ -7874,6 +7874,7 @@ let redirectStatusCodes = new Set([
|
|
|
7874
7874
|
subResourceIntegrity: !1,
|
|
7875
7875
|
ssr: !0,
|
|
7876
7876
|
future: {
|
|
7877
|
+
unstable_enableNodeReadableStream: !1,
|
|
7877
7878
|
unstable_optimizeDeps: !1,
|
|
7878
7879
|
unstable_subResourceIntegrity: !1,
|
|
7879
7880
|
unstable_trailingSlashAwareDataRequests: ((reactRouterVersion = getPackageVersion('react-router'))=>(parseVersionMajorMinor(reactRouterVersion)?.major ?? 0) >= 8)(),
|
|
@@ -9924,11 +9925,18 @@ export {
|
|
|
9924
9925
|
library: {
|
|
9925
9926
|
type: 'module'
|
|
9926
9927
|
},
|
|
9927
|
-
module: !0
|
|
9928
|
+
module: !0,
|
|
9929
|
+
...isBuild ? {
|
|
9930
|
+
chunkFilename: 'static/js/async/[id]-[contenthash:16].js'
|
|
9931
|
+
} : {}
|
|
9928
9932
|
},
|
|
9929
9933
|
webOptimization: {
|
|
9930
9934
|
avoidEntryIife: !0,
|
|
9931
|
-
runtimeChunk: 'single'
|
|
9935
|
+
runtimeChunk: 'single',
|
|
9936
|
+
...isBuild ? {
|
|
9937
|
+
mangleExports: 'size',
|
|
9938
|
+
usedExports: 'global'
|
|
9939
|
+
} : {}
|
|
9932
9940
|
},
|
|
9933
9941
|
nodeExternals: Array.from(new Set([
|
|
9934
9942
|
'express',
|
|
@@ -19,6 +19,7 @@ export type Config = Omit<ReactRouterConfig, 'buildEnd' | 'future' | 'prerender'
|
|
|
19
19
|
subResourceIntegrity?: boolean;
|
|
20
20
|
};
|
|
21
21
|
type FutureConfig = {
|
|
22
|
+
unstable_enableNodeReadableStream: boolean;
|
|
22
23
|
unstable_optimizeDeps: boolean;
|
|
23
24
|
unstable_subResourceIntegrity: boolean;
|
|
24
25
|
unstable_trailingSlashAwareDataRequests: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rsbuild-plugin-react-router",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "React Router plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"@codspeed/vitest-plugin": "^5.7.1",
|
|
82
82
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
83
83
|
"@playwright/test": "^1.61.1",
|
|
84
|
-
"@react-router/dev": "^8.
|
|
85
|
-
"@react-router/express": "^8.
|
|
86
|
-
"@react-router/fs-routes": "^8.
|
|
87
|
-
"@react-router/remix-routes-option-adapter": "^8.
|
|
88
|
-
"@react-router/serve": "^8.
|
|
84
|
+
"@react-router/dev": "^8.3.1",
|
|
85
|
+
"@react-router/express": "^8.3.1",
|
|
86
|
+
"@react-router/fs-routes": "^8.3.1",
|
|
87
|
+
"@react-router/remix-routes-option-adapter": "^8.3.1",
|
|
88
|
+
"@react-router/serve": "^8.3.1",
|
|
89
89
|
"@rsbuild/core": "2.2.0",
|
|
90
90
|
"@rsbuild/plugin-less": "1.6.4",
|
|
91
91
|
"@rsbuild/plugin-mdx": "^1.1.3",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"prettier": "3.8.1",
|
|
120
120
|
"react": "^19.2.4",
|
|
121
121
|
"react-dom": "^19.2.4",
|
|
122
|
-
"react-router": "^7.18.
|
|
123
|
-
"react-router-dom": "^7.18.
|
|
122
|
+
"react-router": "^7.18.3",
|
|
123
|
+
"react-router-dom": "^7.18.3",
|
|
124
124
|
"react-server-dom-rspack": "0.1.0",
|
|
125
125
|
"rsbuild-plugin-rsc": "^0.1.1",
|
|
126
126
|
"semver": "^7.8.5",
|
package/src/mode-plan.ts
CHANGED
|
@@ -345,10 +345,20 @@ const createClassicModePlan = async ({
|
|
|
345
345
|
wasmLoading: 'fetch',
|
|
346
346
|
library: { type: 'module' },
|
|
347
347
|
module: true,
|
|
348
|
+
// Async chunks are addressed by id at runtime, so the chunk name only
|
|
349
|
+
// adds bytes to the filename and to every place that references it.
|
|
350
|
+
...(isBuild
|
|
351
|
+
? { chunkFilename: 'static/js/async/[id]-[contenthash:16].js' }
|
|
352
|
+
: {}),
|
|
348
353
|
},
|
|
349
354
|
webOptimization: {
|
|
350
355
|
avoidEntryIife: true,
|
|
351
356
|
runtimeChunk: 'single',
|
|
357
|
+
// Classic mode resolves route modules through the browser manifest by
|
|
358
|
+
// chunk, not by export name, so production builds can mangle export
|
|
359
|
+
// names and drop exports nothing imports across the whole graph. RSC
|
|
360
|
+
// mode must keep every export name; see createRscModePlan.
|
|
361
|
+
...(isBuild ? { mangleExports: 'size', usedExports: 'global' } : {}),
|
|
352
362
|
},
|
|
353
363
|
nodeExternals: Array.from(
|
|
354
364
|
new Set(['express', ...getSsrExternals(process.cwd())])
|
|
@@ -36,6 +36,10 @@ export type Config = Omit<
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
type FutureConfig = {
|
|
39
|
+
// React Router 8.3 selects the web-streams server entry when this is set.
|
|
40
|
+
// The plugin ships its own server entry, so the flag is resolved and passed
|
|
41
|
+
// through to presets and `buildEnd` but does not change plugin behavior.
|
|
42
|
+
unstable_enableNodeReadableStream: boolean;
|
|
39
43
|
unstable_optimizeDeps: boolean;
|
|
40
44
|
unstable_subResourceIntegrity: boolean;
|
|
41
45
|
unstable_trailingSlashAwareDataRequests: boolean;
|
|
@@ -118,6 +122,7 @@ export type ResolvedReactRouterConfig = Readonly<{
|
|
|
118
122
|
}>;
|
|
119
123
|
|
|
120
124
|
const createDefaultFutureConfig = (): FutureConfig => ({
|
|
125
|
+
unstable_enableNodeReadableStream: false,
|
|
121
126
|
unstable_optimizeDeps: false,
|
|
122
127
|
unstable_subResourceIntegrity: false,
|
|
123
128
|
unstable_trailingSlashAwareDataRequests:
|