@rsbuild/plugin-styled-components 0.7.8 → 0.7.10
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 +6 -1
- package/dist/index.js +6 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,11 @@ __export(src_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(src_exports);
|
|
27
27
|
var import_shared = require("@rsbuild/shared");
|
|
28
|
+
function isServerTarget(target) {
|
|
29
|
+
return (Array.isArray(target) ? target : [target]).some(
|
|
30
|
+
(item) => ["node", "service-worker"].includes(item)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
28
33
|
var getDefaultStyledComponentsConfig = (isProd, ssr) => {
|
|
29
34
|
return {
|
|
30
35
|
ssr,
|
|
@@ -43,7 +48,7 @@ var pluginStyledComponents = (pluginOptions = {}) => ({
|
|
|
43
48
|
return;
|
|
44
49
|
}
|
|
45
50
|
const getMergedOptions = () => {
|
|
46
|
-
const useSSR =
|
|
51
|
+
const useSSR = isServerTarget(api.context.targets);
|
|
47
52
|
const isProd = (0, import_shared.getNodeEnv)() === "production";
|
|
48
53
|
return (0, import_shared.reduceConfigs)({
|
|
49
54
|
initial: getDefaultStyledComponentsConfig(isProd, useSSR),
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,12 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
import path from "path";
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
|
-
import { getNodeEnv,
|
|
10
|
+
import { getNodeEnv, reduceConfigs } from "@rsbuild/shared";
|
|
11
|
+
function isServerTarget(target) {
|
|
12
|
+
return (Array.isArray(target) ? target : [target]).some(
|
|
13
|
+
(item) => ["node", "service-worker"].includes(item)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
11
16
|
var getDefaultStyledComponentsConfig = (isProd, ssr) => {
|
|
12
17
|
return {
|
|
13
18
|
ssr,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-styled-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.10",
|
|
4
4
|
"description": "styled-components plugin for Rsbuild",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@rsbuild/shared": "0.7.
|
|
25
|
+
"@rsbuild/shared": "0.7.10"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "18.x",
|
|
29
29
|
"typescript": "^5.4.2",
|
|
30
|
-
"@rsbuild/core": "0.7.
|
|
30
|
+
"@rsbuild/core": "0.7.10"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@rsbuild/core": "^0.7.
|
|
33
|
+
"@rsbuild/core": "^0.7.10"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public",
|