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: website/docs/en/blog/announcing-1-3.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,7 +156,7 @@ By utilizing modern JavaScript features supported by the target environment, Rsp
156
156
157
157
### Memory improvements
158
158
159
-
Rspack now defaults to using [mimalloc](https://github.com/microsoft/mimalloc) v3 on macOS. This mitigates some memory consumption issue on macOS during rebuilding. According to some community and internal projects, this would lift the RSS for rebuilding, based on the size of each project, varying from **10% to 85%**。
159
+
Rspack now defaults to using [mimalloc](https://github.com/microsoft/mimalloc) v3 on macOS. This mitigates some memory consumption issue on macOS during rebuilding. According to some community and internal projects, this would lift the RSS for rebuilding, based on the size of each project, varying from **10% to 85%**.
160
160
161
161
Rspack 1.3 also implemented an internal mechanism to clean the outdated cache: `maxGenerations`. This controls how many compilations would cache survive if it's not being used by the compiler. Rspack sets the default to `1`. This means that the cache will be purged if it's not being used in the next compilation.
By default, Rspack uses Watchpack to monitor file changes, which generally works well in most scenarios.
835
835
However, in certain specific environments, issues may arise. For example, Watchpack may experience performance problems when there are a large number of file changes.
836
-
More detail see: [Watchpack issue #233](https://github.com/webpack/watchpack/issues/223)。
836
+
More detail see: [Watchpack issue #233](https://github.com/webpack/watchpack/issues/223).
837
837
838
838
If you encounter performance issues with the default watcher, you can try enabling nativeWatcher.
Used to mark the type of the matching module, which affects how the module is handled by Rspack's built-in processing.
2315
2327
2316
-
By default, Rspack will determine the type of the module based on the file extension. For example, `.js` and `.mjs` files will be treated as `javascript/auto` modules, and `.json` files will be treated as `json` modules.
2328
+
By default, Rspack will determine the type of the module based on the file extension. For example:
2329
+
2330
+
- `.js` files will be treated as `javascript/auto` modules.
2331
+
- `.mjs` files, as well as `.js` files in packages with `type="module"` in package.json, will be treated as `javascript/esm` modules.
2332
+
- `.json` files will be treated as `json` modules.
2333
+
- `.css` files will be treated as `css/auto` modules.
2317
2334
2318
2335
For example, if you want to load a `.json` file through a custom loader, you'd need to set the type to `javascript/auto` to bypass Rspack's built-in JSON importing.
2319
2336
@@ -2332,13 +2349,13 @@ export default {
2332
2349
};
2333
2350
```
2334
2351
2335
-
All`type` options are as follows:
2352
+
The meanings of all`type` options are as follows:
2336
2353
2337
-
- `'javascript/auto'`: JavaScript modules, supported module systems: CommonJS, ES modules.
2338
-
- `'javascript/esm'`:JavaScript modules, treated as ES modules.
2339
-
- `'javascript/dynamic'`:JavaScript modules, treated as Script.
2354
+
- `'javascript/auto'`: JavaScript modules. Rspack automatically determines the module type based on file content, providing the best compatibility.
2355
+
- `'javascript/esm'`: JavaScript modules, treated as strict ES modules.
2356
+
- `'javascript/dynamic'`: JavaScript modules, treated as Script.
2340
2357
- `'json'`: JSON data module, see [JSON](/guide/tech/json).
2341
-
- `'css'|'css/module'|'css/auto'`: CSS module, see [Native CSS Support](/guide/tech/css#native-css-support).
2358
+
- `'css'|'css/module'|'css/auto'`: CSS module, see [Built-in CSS support](/guide/tech/css#built-in-css-support).
2342
2359
- `'asset'|'asset/source'|'asset/resource'|'asset/inline'`: Asset module, see [Asset Module](/guide/features/asset-module).
0 commit comments