@modern-js/uni-builder 2.69.4 → 2.69.6

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.
@@ -71,7 +71,7 @@ const rsbuildRscPlugin = ({ appDir, isRspack = true, rscClientRuntimePath, rscSe
71
71
  name: "uni-builder:rsc-rsbuild-plugin",
72
72
  setup(api) {
73
73
  api.modifyBundlerChain({
74
- handler: async (chain, { isServer, CHAIN_ID }) => {
74
+ handler: async (chain, { isServer, CHAIN_ID, isWebWorker }) => {
75
75
  if (!await checkReactVersionAtLeast19(appDir)) {
76
76
  import_core.logger.error("Enable react server component, please make sure the react and react-dom versions are greater than or equal to 19.0.0");
77
77
  process.exit(1);
@@ -149,7 +149,7 @@ const rsbuildRscPlugin = ({ appDir, isRspack = true, rscClientRuntimePath, rscSe
149
149
  flightCssHandler();
150
150
  jsHandler();
151
151
  addServerRscPlugin();
152
- } else {
152
+ } else if (!isWebWorker) {
153
153
  chain.name("client");
154
154
  chain.dependencies([
155
155
  "server"
@@ -35,7 +35,7 @@ class RscClientPlugin {
35
35
  return `client-reference`;
36
36
  }
37
37
  }
38
- const getEntryModule = (compilation) => {
38
+ const getEntryModule = (compilation, type) => {
39
39
  const entryModules = [];
40
40
  for (const [, entryValue] of compilation.entries.entries()) {
41
41
  const entryDependency = entryValue.dependencies.find((dependency) => dependency.constructor.name === `EntryDependency`);
@@ -49,7 +49,9 @@ class RscClientPlugin {
49
49
  }
50
50
  }
51
51
  if (entryModules.length === 0) {
52
- compilation.errors.push(new WebpackError(`Could not find any entries in the compilation.`));
52
+ if (type === "finishMake") {
53
+ compilation.errors.push(new WebpackError(`Could not find any entries in the compilation.`));
54
+ }
53
55
  return [];
54
56
  }
55
57
  return entryModules;
@@ -74,7 +76,7 @@ class RscClientPlugin {
74
76
  };
75
77
  compiler.hooks.finishMake.tap(RscClientPlugin.name, (compilation) => {
76
78
  if (compiler.watchMode) {
77
- const entryModules = getEntryModule(compilation);
79
+ const entryModules = getEntryModule(compilation, "finishMake");
78
80
  for (const entryModule of entryModules) {
79
81
  entryModule.blocks = entryModule.blocks.filter((block) => block.dependencies.some((dependency) => !(dependency instanceof ClientReferenceDependency) || this.clientReferencesMap.has(dependency.request)));
80
82
  addClientReferencesChunks(entryModule);
@@ -106,7 +108,7 @@ class RscClientPlugin {
106
108
  this.clientReferencesMap = import_common.sharedData.get("clientReferencesMap");
107
109
  const onNormalModuleFactoryParser = (parser) => {
108
110
  parser.hooks.program.tap(RscClientPlugin.name, () => {
109
- const entryModules = getEntryModule(compilation);
111
+ const entryModules = getEntryModule(compilation, "jsParse");
110
112
  for (const entryModule of entryModules) {
111
113
  if (entryModule === parser.state.module) {
112
114
  addClientReferencesChunks(entryModule);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/uni-builder",
3
- "version": "2.69.4",
3
+ "version": "2.69.6",
4
4
  "description": "Unified builder for Modern.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -40,7 +40,7 @@
40
40
  "@babel/preset-react": "^7.22.15",
41
41
  "@babel/types": "^7.26.0",
42
42
  "@pmmmwh/react-refresh-webpack-plugin": "0.5.16",
43
- "@rsbuild/core": "1.6.14",
43
+ "@rsbuild/core": "1.6.15",
44
44
  "@rsbuild/plugin-assets-retry": "1.5.0",
45
45
  "@rsbuild/plugin-babel": "1.0.6",
46
46
  "@rsbuild/plugin-check-syntax": "1.6.0",
@@ -90,9 +90,9 @@
90
90
  "ts-loader": "9.4.4",
91
91
  "webpack": "^5.103.0",
92
92
  "webpack-subresource-integrity": "5.1.0",
93
- "@modern-js/utils": "2.69.4",
94
- "@modern-js/flight-server-transform-plugin": "2.69.4",
95
- "@modern-js/babel-preset": "2.69.4"
93
+ "@modern-js/babel-preset": "2.69.6",
94
+ "@modern-js/flight-server-transform-plugin": "2.69.6",
95
+ "@modern-js/utils": "2.69.6"
96
96
  },
97
97
  "devDependencies": {
98
98
  "@rsbuild/plugin-webpack-swc": "1.1.2",
@@ -103,9 +103,9 @@
103
103
  "react-dom": "^18.2.0",
104
104
  "terser": "^5.31.1",
105
105
  "typescript": "^5.3.0",
106
- "@modern-js/types": "2.69.4",
107
- "@scripts/build": "2.66.0",
108
- "@scripts/vitest-config": "2.66.0"
106
+ "@modern-js/types": "2.69.6",
107
+ "@scripts/vitest-config": "2.66.0",
108
+ "@scripts/build": "2.66.0"
109
109
  },
110
110
  "publishConfig": {
111
111
  "access": "public",