@rsbuild/plugin-react 0.0.0-nightly-20231025160936 → 0.0.8
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/antd.d.ts +2 -3
- package/dist/antd.js +4 -10
- package/dist/arco.js +1 -2
- package/package.json +6 -6
package/dist/antd.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const applyAntdSupport: (api: SharedRsbuildPluginAPI) => void;
|
|
3
|
-
export declare function useSSR(target: RsbuildTarget | RsbuildTarget[]): boolean;
|
|
1
|
+
import { type SharedRsbuildPluginAPI } from '@rsbuild/shared';
|
|
2
|
+
export declare const applyAntdSupport: (api: SharedRsbuildPluginAPI) => void;
|
package/dist/antd.js
CHANGED
|
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var antd_exports = {};
|
|
20
20
|
__export(antd_exports, {
|
|
21
|
-
applyAntdSupport: () => applyAntdSupport
|
|
22
|
-
useSSR: () => useSSR
|
|
21
|
+
applyAntdSupport: () => applyAntdSupport
|
|
23
22
|
});
|
|
24
23
|
module.exports = __toCommonJS(antd_exports);
|
|
24
|
+
var import_shared = require("@rsbuild/shared");
|
|
25
25
|
const getAntdMajorVersion = (appDirectory) => {
|
|
26
26
|
try {
|
|
27
27
|
const pkgJsonPath = require.resolve("antd/package.json", {
|
|
@@ -49,20 +49,14 @@ const applyAntdSupport = (api) => {
|
|
|
49
49
|
...rsbuildConfig.source.transformImport || [],
|
|
50
50
|
{
|
|
51
51
|
libraryName: "antd",
|
|
52
|
-
libraryDirectory: useSSR(api.context.target) ? "lib" : "es",
|
|
52
|
+
libraryDirectory: (0, import_shared.useSSR)(api.context.target) ? "lib" : "es",
|
|
53
53
|
style: true
|
|
54
54
|
}
|
|
55
55
|
];
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
-
function useSSR(target) {
|
|
60
|
-
return (Array.isArray(target) ? target : [target]).some(
|
|
61
|
-
(item) => ["node", "service-worker"].includes(item)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
65
60
|
0 && (module.exports = {
|
|
66
|
-
applyAntdSupport
|
|
67
|
-
useSSR
|
|
61
|
+
applyAntdSupport
|
|
68
62
|
});
|
package/dist/arco.js
CHANGED
|
@@ -21,7 +21,6 @@ __export(arco_exports, {
|
|
|
21
21
|
applyArcoSupport: () => applyArcoSupport
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(arco_exports);
|
|
24
|
-
var import_antd = require("./antd");
|
|
25
24
|
var import_shared = require("@rsbuild/shared");
|
|
26
25
|
const applyArcoSupport = (api) => {
|
|
27
26
|
const ARCO_NAME = "@arco-design/web-react";
|
|
@@ -31,7 +30,7 @@ const applyArcoSupport = (api) => {
|
|
|
31
30
|
if (transformImport === false || !(0, import_shared.isPackageInstalled)(ARCO_NAME, api.context.rootPath)) {
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
|
-
const isUseSSR = (0,
|
|
33
|
+
const isUseSSR = (0, import_shared.useSSR)(api.context.target);
|
|
35
34
|
if (!(transformImport == null ? void 0 : transformImport.some((item) => item.libraryName === ARCO_NAME))) {
|
|
36
35
|
transformImport.push({
|
|
37
36
|
libraryName: ARCO_NAME,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "React plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@rspack/plugin-react-refresh": "0.3.8",
|
|
24
23
|
"@babel/preset-react": "^7.22.15",
|
|
25
24
|
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
|
|
25
|
+
"@rspack/plugin-react-refresh": "0.3.8",
|
|
26
26
|
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
|
|
27
|
-
"@rsbuild/shared": "0.0.
|
|
27
|
+
"@rsbuild/shared": "0.0.8"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/node": "^16",
|
|
31
31
|
"typescript": "^5",
|
|
32
|
-
"@rsbuild/
|
|
33
|
-
"@rsbuild/
|
|
34
|
-
"@rsbuild/webpack": "0.0.
|
|
32
|
+
"@rsbuild/test-helper": "0.0.8",
|
|
33
|
+
"@rsbuild/core": "0.0.8",
|
|
34
|
+
"@rsbuild/webpack": "0.0.8"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"registry": "https://registry.npmjs.org/",
|