@bleedingdev/modern-js-builder 3.5.0-ultramodern.30 → 3.5.0-ultramodern.32
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.
|
@@ -204,6 +204,13 @@ function pluginRscConfig() {
|
|
|
204
204
|
handler: (chain, { isServer })=>{
|
|
205
205
|
if (isServer) {
|
|
206
206
|
chain.resolve.alias.set(`${RENDER_RSC_RUNTIME}$`, RENDER_RSC_WORKER_RUNTIME);
|
|
207
|
+
let emptyModulePath;
|
|
208
|
+
try {
|
|
209
|
+
emptyModulePath = require.resolve('../shared/rsc/rscEmptyModule');
|
|
210
|
+
} catch {
|
|
211
|
+
emptyModulePath = external_path_default().resolve(__dirname, '../shared/rsc/rscEmptyModule');
|
|
212
|
+
}
|
|
213
|
+
chain.resolve.alias.set('server-only$', emptyModulePath);
|
|
207
214
|
const routeFilePattern = /[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.[tj]sx?$/;
|
|
208
215
|
const appFilePattern = /[/\\]App\.[tj]sx?$/;
|
|
209
216
|
const combinedPattern = new RegExp(`(${routeFilePattern.source}|${appFilePattern.source})`);
|
|
@@ -277,7 +284,8 @@ function pluginRscConfig() {
|
|
|
277
284
|
}
|
|
278
285
|
async function getRscPlugins(enableRsc, internalDirectory, environments) {
|
|
279
286
|
if (enableRsc) {
|
|
280
|
-
|
|
287
|
+
new RegExp(`${internalDirectory.replace(/[/\\]/g, '[/\\\\]')}[/\\\\][^/\\\\]*[/\\\\]routes`);
|
|
288
|
+
const routeDataFileReg = /[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.(?:loader|data)\.[tj]sx?(?:\?.*)?$/;
|
|
281
289
|
const { pluginRSC } = await import("rsbuild-plugin-rsc");
|
|
282
290
|
return [
|
|
283
291
|
pluginRSC({
|
|
@@ -290,7 +298,7 @@ async function getRscPlugins(enableRsc, internalDirectory, environments) {
|
|
|
290
298
|
RENDER_RSC_SOURCE_PATTERN,
|
|
291
299
|
RENDER_RSC_RSLIB_ENTRY_PATTERN,
|
|
292
300
|
/AppProxy/,
|
|
293
|
-
|
|
301
|
+
routeDataFileReg
|
|
294
302
|
]
|
|
295
303
|
}
|
|
296
304
|
}),
|
|
@@ -160,6 +160,13 @@ function pluginRscConfig() {
|
|
|
160
160
|
handler: (chain, { isServer })=>{
|
|
161
161
|
if (isServer) {
|
|
162
162
|
chain.resolve.alias.set(`${RENDER_RSC_RUNTIME}$`, RENDER_RSC_WORKER_RUNTIME);
|
|
163
|
+
let emptyModulePath;
|
|
164
|
+
try {
|
|
165
|
+
emptyModulePath = require.resolve('../shared/rsc/rscEmptyModule');
|
|
166
|
+
} catch {
|
|
167
|
+
emptyModulePath = path.resolve(__dirname, '../shared/rsc/rscEmptyModule');
|
|
168
|
+
}
|
|
169
|
+
chain.resolve.alias.set('server-only$', emptyModulePath);
|
|
163
170
|
const routeFilePattern = /[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.[tj]sx?$/;
|
|
164
171
|
const appFilePattern = /[/\\]App\.[tj]sx?$/;
|
|
165
172
|
const combinedPattern = new RegExp(`(${routeFilePattern.source}|${appFilePattern.source})`);
|
|
@@ -233,7 +240,8 @@ function pluginRscConfig() {
|
|
|
233
240
|
}
|
|
234
241
|
async function getRscPlugins(enableRsc, internalDirectory, environments) {
|
|
235
242
|
if (enableRsc) {
|
|
236
|
-
|
|
243
|
+
new RegExp(`${internalDirectory.replace(/[/\\]/g, '[/\\\\]')}[/\\\\][^/\\\\]*[/\\\\]routes`);
|
|
244
|
+
const routeDataFileReg = /[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.(?:loader|data)\.[tj]sx?(?:\?.*)?$/;
|
|
237
245
|
const { pluginRSC } = await import("rsbuild-plugin-rsc");
|
|
238
246
|
return [
|
|
239
247
|
pluginRSC({
|
|
@@ -246,7 +254,7 @@ async function getRscPlugins(enableRsc, internalDirectory, environments) {
|
|
|
246
254
|
RENDER_RSC_SOURCE_PATTERN,
|
|
247
255
|
RENDER_RSC_RSLIB_ENTRY_PATTERN,
|
|
248
256
|
/AppProxy/,
|
|
249
|
-
|
|
257
|
+
routeDataFileReg
|
|
250
258
|
]
|
|
251
259
|
}
|
|
252
260
|
}),
|
|
@@ -165,6 +165,13 @@ function pluginRscConfig() {
|
|
|
165
165
|
handler: (chain, { isServer })=>{
|
|
166
166
|
if (isServer) {
|
|
167
167
|
chain.resolve.alias.set(`${RENDER_RSC_RUNTIME}$`, RENDER_RSC_WORKER_RUNTIME);
|
|
168
|
+
let emptyModulePath;
|
|
169
|
+
try {
|
|
170
|
+
emptyModulePath = require.resolve('../shared/rsc/rscEmptyModule');
|
|
171
|
+
} catch {
|
|
172
|
+
emptyModulePath = path.resolve(__rspack_import_meta_dirname__, '../shared/rsc/rscEmptyModule');
|
|
173
|
+
}
|
|
174
|
+
chain.resolve.alias.set('server-only$', emptyModulePath);
|
|
168
175
|
const routeFilePattern = /[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.[tj]sx?$/;
|
|
169
176
|
const appFilePattern = /[/\\]App\.[tj]sx?$/;
|
|
170
177
|
const combinedPattern = new RegExp(`(${routeFilePattern.source}|${appFilePattern.source})`);
|
|
@@ -238,7 +245,8 @@ function pluginRscConfig() {
|
|
|
238
245
|
}
|
|
239
246
|
async function getRscPlugins(enableRsc, internalDirectory, environments) {
|
|
240
247
|
if (enableRsc) {
|
|
241
|
-
|
|
248
|
+
new RegExp(`${internalDirectory.replace(/[/\\]/g, '[/\\\\]')}[/\\\\][^/\\\\]*[/\\\\]routes`);
|
|
249
|
+
const routeDataFileReg = /[/\\]routes[/\\](?:.*[/\\])?(?:layout|page|\$)\.(?:loader|data)\.[tj]sx?(?:\?.*)?$/;
|
|
242
250
|
const { pluginRSC } = await import("rsbuild-plugin-rsc");
|
|
243
251
|
return [
|
|
244
252
|
pluginRSC({
|
|
@@ -251,7 +259,7 @@ async function getRscPlugins(enableRsc, internalDirectory, environments) {
|
|
|
251
259
|
RENDER_RSC_SOURCE_PATTERN,
|
|
252
260
|
RENDER_RSC_RSLIB_ENTRY_PATTERN,
|
|
253
261
|
/AppProxy/,
|
|
254
|
-
|
|
262
|
+
routeDataFileReg
|
|
255
263
|
]
|
|
256
264
|
}
|
|
257
265
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bleedingdev/modern-js-builder",
|
|
3
|
-
"version": "3.5.0-ultramodern.
|
|
3
|
+
"version": "3.5.0-ultramodern.32",
|
|
4
4
|
"description": "A builder for Modern.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"rsbuild-plugin-rsc": "0.1.1",
|
|
60
60
|
"rspack-manifest-plugin": "5.2.2",
|
|
61
61
|
"ts-deepmerge": "8.0.0",
|
|
62
|
-
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.
|
|
62
|
+
"@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.32"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@rslib/core": "0.23.1",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"react": "^19.2.7",
|
|
69
69
|
"terser": "^5.48.0",
|
|
70
70
|
"typescript": "^6.0.3",
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
71
|
+
"@scripts/rstest-config": "2.66.0",
|
|
72
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.32"
|
|
73
73
|
},
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public",
|