You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/document/docs/en/guide/more/faq.mdx
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,6 +61,56 @@ module.exports = {
61
61
- Cause: During the build process, the source code information is stored, which exceeds the memory limit. Enabling the `lite` mode can alleviate this issue.
62
62
- Difference: The difference between the **lite mode** and the **normal mode** is that the **lite mode** no longer stores the **source code information**, only the **bundled code** is stored. Additionally, the code displayed in the analysis report will only consist of the **bundled code**.
63
63
64
+
## Bundle analysis page no `Bundled Size`?
65
+
66
+
### Issue Description
67
+
68
+
The difference between `Source Size` and `Bundled Size`:
69
+
70
+
-**Source Size**: The original size of the Module source code file (marked in purple in the image below).
71
+
-**Bundled Size**: The final code size of the Module after bundling and minification (marked in cyan in the image below).
When [optimization.concatenateModules](https://rspack.rs/config/optimization#optimizationconcatenatemodules) is set to `true`, Rsdoctor cannot use `acorn` to parse the build artifacts and break down the actual code size of each **Module**, therefore it cannot display the `Bundled Size`.
78
+
79
+
### Solution
80
+
81
+
:::danger
82
+
**Important Note:** You must check the `RSDOCTOR` environment variable and not modify ConcatenateModules directly! ConcatenateModules is enabled by default in production environments, and disabling it in production builds will increase the bundle size.
83
+
:::
84
+
85
+
When enabling Rsdoctor analysis, set **concatenateModules to false** as shown below. **Note: Disabling `concatenateModules` will slightly increase bundle size, creating differences from production builds.**
86
+
87
+
```js rspack.config.mjs
88
+
exportdefault {
89
+
optimization: {
90
+
concatenateModules:
91
+
process.env.NODE_ENV==='production'&&!process.env.RSDOCTOR, // Must check RSDOCTOR environment variable, do not modify concatenateModules directly!
92
+
},
93
+
};
94
+
```
95
+
96
+
- In the rspeedy project, configure it in `rspeedy.config.ts`:
97
+
98
+
```js rspeedy.config.ts
99
+
exportdefault {
100
+
tools: {
101
+
rspack(config, { env }) {
102
+
if (process.env.RSDOCTOR==='true') {
103
+
config.optimization= {
104
+
...config.optimization,
105
+
concatenateModules:false,
106
+
},
107
+
return config
108
+
}
109
+
},
110
+
},
111
+
};
112
+
```
113
+
64
114
## The loader of CssExtractRspackPlugin takes too long
65
115
66
116
When using Rsdoctor to analyze the compilation time of Rspack projects, you may find that the loader of [CssExtractRspackPlugin](https://rspack.rs/plugins/rspack/css-extract-rspack-plugin) takes a long time. However, this figure does not represent the actual time taken by the CssExtractRspackPlugin's loader; it also includes the time taken by other loaders involved in compiling this module.
0 commit comments