rsbuild-plugin-react-router 0.0.2 → 0.0.4

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 CHANGED
@@ -327,9 +327,9 @@ export { ${output.exports.map((exp)=>'default' === exp ? 'defaultExport as defau
327
327
  });
328
328
  let jiti = (0, external_jiti_namespaceObject.createJiti)(process.cwd()), { appDirectory = 'app', basename = '/', buildDirectory = 'build', ssr = !0 } = await jiti.import('./react-router.config.ts', {
329
329
  default: !0
330
- }).catch(()=>(console.error('No react-router.config.ts found, using default configuration.'), {})), routesPath = (0, external_pathe_namespaceObject.resolve)(appDirectory, 'routes.ts'), routeConfig = await jiti.import(routesPath, {
330
+ }).catch(()=>(console.error('No react-router.config.ts found, using default configuration.'), {})), routesPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, 'routes')), routeConfig = await jiti.import(routesPath, {
331
331
  default: !0
332
- }).catch((error)=>(console.error('Failed to load routes.ts:', error), console.error('No routes.ts found in app directory.'), [])), entryClientPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, 'entry.client')), entryServerPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, 'entry.server')), serverAppPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, '../server/index')), hasServerApp = (0, external_node_fs_namespaceObject.existsSync)(serverAppPath), templateDir = (0, external_pathe_namespaceObject.resolve)(__dirname, 'templates'), templateClientPath = (0, external_pathe_namespaceObject.resolve)(templateDir, 'entry.client.js'), templateServerPath = (0, external_pathe_namespaceObject.resolve)(templateDir, 'entry.server.js'), finalEntryClientPath = (0, external_node_fs_namespaceObject.existsSync)(entryClientPath) ? entryClientPath : templateClientPath, finalEntryServerPath = (0, external_node_fs_namespaceObject.existsSync)(entryServerPath) ? entryServerPath : templateServerPath, routes = {
332
+ }).catch((error)=>(console.error('Failed to load routes file:', error), console.error('No routes file found in app directory.'), [])), entryClientPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, 'entry.client')), entryServerPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, 'entry.server')), serverAppPath = findEntryFile((0, external_pathe_namespaceObject.resolve)(appDirectory, '../server/index')), hasServerApp = (0, external_node_fs_namespaceObject.existsSync)(serverAppPath), templateDir = (0, external_pathe_namespaceObject.resolve)(__dirname, 'templates'), templateClientPath = (0, external_pathe_namespaceObject.resolve)(templateDir, 'entry.client.js'), templateServerPath = (0, external_pathe_namespaceObject.resolve)(templateDir, 'entry.server.js'), finalEntryClientPath = (0, external_node_fs_namespaceObject.existsSync)(entryClientPath) ? entryClientPath : templateClientPath, finalEntryServerPath = (0, external_node_fs_namespaceObject.existsSync)(entryServerPath) ? entryServerPath : templateServerPath, routes = {
333
333
  root: {
334
334
  path: '',
335
335
  id: 'root',
@@ -608,7 +608,7 @@ export { ${output.exports.map((exp)=>'default' === exp ? 'defaultExport as defau
608
608
  },
609
609
  tools: {
610
610
  rspack: {
611
- target: 'async-node',
611
+ target: options.federation ? 'async-node' : 'node',
612
612
  externals: [
613
613
  'express'
614
614
  ],
package/dist/index.js CHANGED
@@ -312,9 +312,9 @@ let pluginReactRouter = (options = {})=>({
312
312
  });
313
313
  let jiti = (0, __WEBPACK_EXTERNAL_MODULE_jiti__.createJiti)(process.cwd()), { appDirectory = 'app', basename = '/', buildDirectory = 'build', ssr = !0 } = await jiti.import('./react-router.config.ts', {
314
314
  default: !0
315
- }).catch(()=>(console.error('No react-router.config.ts found, using default configuration.'), {})), routesPath = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, 'routes.ts'), routeConfig = await jiti.import(routesPath, {
315
+ }).catch(()=>(console.error('No react-router.config.ts found, using default configuration.'), {})), routesPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, 'routes')), routeConfig = await jiti.import(routesPath, {
316
316
  default: !0
317
- }).catch((error)=>(console.error('Failed to load routes.ts:', error), console.error('No routes.ts found in app directory.'), [])), entryClientPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, 'entry.client')), entryServerPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, 'entry.server')), serverAppPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, '../server/index')), hasServerApp = (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.existsSync)(serverAppPath), templateDir = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(src_rslib_entry_dirname, 'templates'), templateClientPath = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(templateDir, 'entry.client.js'), templateServerPath = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(templateDir, 'entry.server.js'), finalEntryClientPath = (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.existsSync)(entryClientPath) ? entryClientPath : templateClientPath, finalEntryServerPath = (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.existsSync)(entryServerPath) ? entryServerPath : templateServerPath, routes = {
317
+ }).catch((error)=>(console.error('Failed to load routes file:', error), console.error('No routes file found in app directory.'), [])), entryClientPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, 'entry.client')), entryServerPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, 'entry.server')), serverAppPath = findEntryFile((0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(appDirectory, '../server/index')), hasServerApp = (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.existsSync)(serverAppPath), templateDir = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(src_rslib_entry_dirname, 'templates'), templateClientPath = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(templateDir, 'entry.client.js'), templateServerPath = (0, __WEBPACK_EXTERNAL_MODULE_pathe__.resolve)(templateDir, 'entry.server.js'), finalEntryClientPath = (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.existsSync)(entryClientPath) ? entryClientPath : templateClientPath, finalEntryServerPath = (0, __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__.existsSync)(entryServerPath) ? entryServerPath : templateServerPath, routes = {
318
318
  root: {
319
319
  path: '',
320
320
  id: 'root',
@@ -593,7 +593,7 @@ let pluginReactRouter = (options = {})=>({
593
593
  },
594
594
  tools: {
595
595
  rspack: {
596
- target: 'async-node',
596
+ target: options.federation ? 'async-node' : 'node',
597
597
  externals: [
598
598
  'express'
599
599
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsbuild-plugin-react-router",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "React Router plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -54,7 +54,7 @@
54
54
  "@babel/traverse": "^7.26.3",
55
55
  "@babel/types": "^7.26.3",
56
56
  "@mjackson/node-fetch-server": "^0.3.0",
57
- "@react-router/node": "^7.4.0",
57
+ "@react-router/node": "^7.4.1",
58
58
  "@rspack/plugin-react-refresh": "^1.0.1",
59
59
  "babel-dead-code-elimination": "^1.0.8",
60
60
  "esbuild": "^0.24.2",
@@ -69,11 +69,11 @@
69
69
  },
70
70
  "devDependencies": {
71
71
  "@changesets/cli": "^2.28.1",
72
- "@react-router/dev": "^7.4.0",
73
- "@react-router/node": "^7.4.0",
74
- "@rsbuild/core": "1.3.0-beta.2",
72
+ "@react-router/dev": "^7.4.1",
73
+ "@react-router/node": "^7.4.1",
74
+ "@rsbuild/core": "1.3.2",
75
75
  "@rslib/core": "^0.5.4",
76
- "@rspack/core": "1.3.0-beta.1",
76
+ "@rspack/core": "1.3.1",
77
77
  "@types/babel__core": "^7.6.8",
78
78
  "@types/babel__generator": "^7.6.8",
79
79
  "@types/babel__traverse": "^7.20.6",
@@ -89,14 +89,14 @@
89
89
  "prettier": "3.4.2",
90
90
  "react": "^19.0.0",
91
91
  "react-dom": "^19.0.0",
92
- "react-router": "^7.4.0",
93
- "react-router-dom": "^7.4.0",
92
+ "react-router": "^7.4.1",
93
+ "react-router-dom": "^7.4.1",
94
94
  "typescript": "^5.7.2",
95
95
  "vitest": "^3.0.5",
96
96
  "@rsbuild/config": "1.0.1"
97
97
  },
98
98
  "peerDependencies": {
99
- "@rsbuild/core": "^1.3.0"
99
+ "@rsbuild/core": "^1.3.2"
100
100
  },
101
101
  "publishConfig": {
102
102
  "access": "public",
@@ -117,6 +117,6 @@
117
117
  "changeset": "changeset",
118
118
  "version": "changeset version",
119
119
  "release": "changeset publish",
120
- "release:local": "pnpm build && changeset version && changeset publish"
120
+ "release:local": "pnpm build && changeset version && changeset publish && git add . && git commit -m \"chore: version packages\" && git push && git push --tags"
121
121
  }
122
122
  }