@rsbuild/webpack 0.2.5 → 0.2.7
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/README.md +6 -8
- package/dist/core/webpackConfig.js +1 -0
- package/dist/plugins/minimize.js +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -13,22 +13,20 @@ Note that this package is mainly used for compatibility with Modern.js and Rsbui
|
|
|
13
13
|
```ts
|
|
14
14
|
import { defineConfig } from '@rsbuild/core';
|
|
15
15
|
import { webpackProvider } from '@rsbuild/webpack';
|
|
16
|
-
import {
|
|
17
|
-
import { pluginCssMinimizer } from '@rsbuild/plugin-css-minimizer';
|
|
16
|
+
import { pluginSwc } from '@rsbuild/plugin-swc';
|
|
18
17
|
|
|
19
18
|
export default defineConfig({
|
|
20
19
|
provider: webpackProvider,
|
|
21
20
|
plugins: [
|
|
22
|
-
// @rsbuild/webpack has no built-in transformer,
|
|
23
|
-
// so you need to register the plugin-
|
|
24
|
-
|
|
25
|
-
// @rsbuild/webpack has no built-in CSS minimizer,
|
|
26
|
-
// so you need to register the plugin-css-minimizer.
|
|
27
|
-
pluginCssMinimizer(),
|
|
21
|
+
// @rsbuild/webpack has no built-in transformer and minimizer,
|
|
22
|
+
// so you need to register the plugin-swc.
|
|
23
|
+
pluginSwc(),
|
|
28
24
|
],
|
|
29
25
|
});
|
|
30
26
|
```
|
|
31
27
|
|
|
28
|
+
> Note that some Rsbuild plugins cannot be used with the webpack provider.
|
|
29
|
+
|
|
32
30
|
## Documentation
|
|
33
31
|
|
|
34
32
|
https://rsbuild.dev/
|
|
@@ -36,6 +36,7 @@ var import_shared2 = require("../shared");
|
|
|
36
36
|
async function modifyWebpackChain(context, utils, chain) {
|
|
37
37
|
(0, import_shared.debug)("modify webpack chain");
|
|
38
38
|
const [modifiedChain] = await context.hooks.modifyWebpackChainHook.call(
|
|
39
|
+
// @ts-expect-error `chain` in the sig of modifyWebpackChainHook is `RspackChain`.
|
|
39
40
|
chain,
|
|
40
41
|
utils
|
|
41
42
|
);
|
package/dist/plugins/minimize.js
CHANGED
|
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(minimize_exports);
|
|
|
34
34
|
var import_shared = require("@rsbuild/shared");
|
|
35
35
|
async function applyJSMinimizer(chain, config) {
|
|
36
36
|
const { default: TerserPlugin } = await Promise.resolve().then(() => __toESM(require("terser-webpack-plugin")));
|
|
37
|
-
const finalOptions = await (0, import_shared.
|
|
37
|
+
const finalOptions = await (0, import_shared.getTerserMinifyOptions)(config);
|
|
38
38
|
chain.optimization.minimizer(import_shared.CHAIN_ID.MINIMIZER.JS).use(TerserPlugin, [
|
|
39
39
|
// Due to terser-webpack-plugin has changed the type of class, which using a generic type in
|
|
40
40
|
// constructor, leading auto inference of parameters of plugin constructor is not possible, using any instead
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/webpack",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"homepage": "https://rsbuild.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
"terser-webpack-plugin": "5.3.9",
|
|
37
37
|
"tsconfig-paths-webpack-plugin": "4.1.0",
|
|
38
38
|
"webpack": "^5.89.0",
|
|
39
|
-
"
|
|
40
|
-
"@rsbuild/
|
|
39
|
+
"webpack-chain": "^6.5.1",
|
|
40
|
+
"@rsbuild/core": "0.2.7",
|
|
41
|
+
"@rsbuild/shared": "0.2.7"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@types/node": "16.x",
|
|
44
45
|
"typescript": "^5.3.0",
|
|
45
|
-
"@rsbuild/test-helper": "0.2.
|
|
46
|
+
"@rsbuild/test-helper": "0.2.7"
|
|
46
47
|
},
|
|
47
48
|
"publishConfig": {
|
|
48
49
|
"access": "public",
|