@rsbuild/plugin-styled-components 1.0.1-beta.4 → 1.0.1-beta.5
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/index.cjs +23 -25
- package/dist/index.js +23 -25
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -62,35 +62,33 @@ var pluginStyledComponents = (pluginOptions = {}) => ({
|
|
|
62
62
|
config: pluginOptions
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
api.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
mergedOptions
|
|
85
|
-
]
|
|
65
|
+
api.modifyEnvironmentConfig((userConfig, { mergeEnvironmentConfig }) => {
|
|
66
|
+
const rsbuildConfig = api.getRsbuildConfig();
|
|
67
|
+
const targets = rsbuildConfig.environments ? Object.values(rsbuildConfig.environments).map(
|
|
68
|
+
(e) => e.output?.target || userConfig.output?.target || "web"
|
|
69
|
+
) : [userConfig.output?.target || "web"];
|
|
70
|
+
const useSSR = isServerTarget(targets);
|
|
71
|
+
const mergedOptions = getMergedOptions(useSSR);
|
|
72
|
+
if (!mergedOptions) {
|
|
73
|
+
return userConfig;
|
|
74
|
+
}
|
|
75
|
+
const extraConfig = {
|
|
76
|
+
tools: {
|
|
77
|
+
swc: {
|
|
78
|
+
jsc: {
|
|
79
|
+
experimental: {
|
|
80
|
+
plugins: [
|
|
81
|
+
[
|
|
82
|
+
require.resolve("@swc/plugin-styled-components"),
|
|
83
|
+
mergedOptions
|
|
86
84
|
]
|
|
87
|
-
|
|
85
|
+
]
|
|
88
86
|
}
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return mergeEnvironmentConfig(extraConfig, userConfig);
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
});
|
package/dist/index.js
CHANGED
|
@@ -42,35 +42,33 @@ var pluginStyledComponents = (pluginOptions = {}) => ({
|
|
|
42
42
|
config: pluginOptions
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
-
api.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
mergedOptions
|
|
65
|
-
]
|
|
45
|
+
api.modifyEnvironmentConfig((userConfig, { mergeEnvironmentConfig }) => {
|
|
46
|
+
const rsbuildConfig = api.getRsbuildConfig();
|
|
47
|
+
const targets = rsbuildConfig.environments ? Object.values(rsbuildConfig.environments).map(
|
|
48
|
+
(e) => e.output?.target || userConfig.output?.target || "web"
|
|
49
|
+
) : [userConfig.output?.target || "web"];
|
|
50
|
+
const useSSR = isServerTarget(targets);
|
|
51
|
+
const mergedOptions = getMergedOptions(useSSR);
|
|
52
|
+
if (!mergedOptions) {
|
|
53
|
+
return userConfig;
|
|
54
|
+
}
|
|
55
|
+
const extraConfig = {
|
|
56
|
+
tools: {
|
|
57
|
+
swc: {
|
|
58
|
+
jsc: {
|
|
59
|
+
experimental: {
|
|
60
|
+
plugins: [
|
|
61
|
+
[
|
|
62
|
+
__require.resolve("@swc/plugin-styled-components"),
|
|
63
|
+
mergedOptions
|
|
66
64
|
]
|
|
67
|
-
|
|
65
|
+
]
|
|
68
66
|
}
|
|
69
67
|
}
|
|
70
68
|
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return mergeEnvironmentConfig(extraConfig, userConfig);
|
|
74
72
|
});
|
|
75
73
|
}
|
|
76
74
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-styled-components",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.5",
|
|
4
4
|
"description": "styled-components plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "18.x",
|
|
30
30
|
"typescript": "^5.5.2",
|
|
31
|
-
"@rsbuild/core": "1.0.1-beta.
|
|
31
|
+
"@rsbuild/core": "1.0.1-beta.5"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@rsbuild/core": "^1.0.1-beta.0"
|