@winner-fed/bundler-rsbuild 0.18.5 → 0.18.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.
|
@@ -9,7 +9,9 @@ interface IOpts {
|
|
|
9
9
|
port?: number;
|
|
10
10
|
}
|
|
11
11
|
export declare function resolveDefine(opts: IOpts): {
|
|
12
|
-
'process.env':
|
|
12
|
+
'process.env': {
|
|
13
|
+
[k: string]: string;
|
|
14
|
+
};
|
|
13
15
|
};
|
|
14
16
|
export declare function getSourceConfig(opts: IOpts): SourceConfig;
|
|
15
17
|
export {};
|
|
@@ -55,8 +55,9 @@ function resolveDefine(opts) {
|
|
|
55
55
|
env[key] = envValue;
|
|
56
56
|
});
|
|
57
57
|
env.PUBLIC_PATH = (userConfig == null ? void 0 : userConfig.publicPath) || "/";
|
|
58
|
+
const processEnvDefines = {};
|
|
58
59
|
for (const key in env) {
|
|
59
|
-
env
|
|
60
|
+
processEnvDefines[`process.env.${key}`] = JSON.stringify(env[key]);
|
|
60
61
|
}
|
|
61
62
|
const define = {};
|
|
62
63
|
if (userConfig == null ? void 0 : userConfig.define) {
|
|
@@ -65,7 +66,12 @@ function resolveDefine(opts) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
return {
|
|
68
|
-
|
|
69
|
+
// 传统的 process.env 对象方式(向后兼容)
|
|
70
|
+
"process.env": Object.fromEntries(
|
|
71
|
+
Object.entries(env).map(([k, v]) => [k, JSON.stringify(v)])
|
|
72
|
+
),
|
|
73
|
+
// 直接的 process.env.KEY 方式(支持模板字符串)
|
|
74
|
+
...processEnvDefines,
|
|
69
75
|
...define
|
|
70
76
|
};
|
|
71
77
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@winner-fed/bundler-rsbuild",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.6",
|
|
4
4
|
"description": "@winner-fed/bundler-rsbuild",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@rsbuild/core": "1.5.
|
|
15
|
+
"@rsbuild/core": "1.5.17",
|
|
16
16
|
"@rsbuild/plugin-babel": "1.0.6",
|
|
17
17
|
"@rsbuild/plugin-less": "1.5.0",
|
|
18
18
|
"@rsbuild/plugin-node-polyfill": "1.4.2",
|
|
19
19
|
"@rsbuild/plugin-sass": "1.4.0",
|
|
20
20
|
"@rsbuild/plugin-stylus": "1.2.0",
|
|
21
21
|
"@rsbuild/plugin-type-check": "1.2.4",
|
|
22
|
-
"@winner-fed/bundler-utils": "0.18.
|
|
23
|
-
"@winner-fed/utils": "0.18.
|
|
22
|
+
"@winner-fed/bundler-utils": "0.18.6",
|
|
23
|
+
"@winner-fed/utils": "0.18.6"
|
|
24
24
|
},
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|