@rsbuild/plugin-styled-components 1.0.1-beta.4 → 1.0.1-beta.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.
package/dist/index.cjs CHANGED
@@ -62,35 +62,33 @@ var pluginStyledComponents = (pluginOptions = {}) => ({
62
62
  config: pluginOptions
63
63
  });
64
64
  };
65
- api.modifyRsbuildConfig({
66
- order: "post",
67
- handler: (userConfig, { mergeRsbuildConfig }) => {
68
- const targets = userConfig.environments ? Object.values(userConfig.environments).map(
69
- (e) => e.output?.target || userConfig.output?.target || "web"
70
- ) : [userConfig.output?.target || "web"];
71
- const useSSR = isServerTarget(targets);
72
- const mergedOptions = getMergedOptions(useSSR);
73
- if (!mergedOptions) {
74
- return userConfig;
75
- }
76
- const extraConfig = {
77
- tools: {
78
- swc: {
79
- jsc: {
80
- experimental: {
81
- plugins: [
82
- [
83
- require.resolve("@swc/plugin-styled-components"),
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
- return mergeRsbuildConfig(extraConfig, userConfig);
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.modifyRsbuildConfig({
46
- order: "post",
47
- handler: (userConfig, { mergeRsbuildConfig }) => {
48
- const targets = userConfig.environments ? Object.values(userConfig.environments).map(
49
- (e) => e.output?.target || userConfig.output?.target || "web"
50
- ) : [userConfig.output?.target || "web"];
51
- const useSSR = isServerTarget(targets);
52
- const mergedOptions = getMergedOptions(useSSR);
53
- if (!mergedOptions) {
54
- return userConfig;
55
- }
56
- const extraConfig = {
57
- tools: {
58
- swc: {
59
- jsc: {
60
- experimental: {
61
- plugins: [
62
- [
63
- __require.resolve("@swc/plugin-styled-components"),
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
- return mergeRsbuildConfig(extraConfig, userConfig);
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.4",
3
+ "version": "1.0.1-beta.6",
4
4
  "description": "styled-components plugin for Rsbuild",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,13 +22,13 @@
22
22
  "dist"
23
23
  ],
24
24
  "dependencies": {
25
- "@swc/plugin-styled-components": "2.0.9",
25
+ "@swc/plugin-styled-components": "2.0.10",
26
26
  "reduce-configs": "^1.0.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "18.x",
30
30
  "typescript": "^5.5.2",
31
- "@rsbuild/core": "1.0.1-beta.4"
31
+ "@rsbuild/core": "1.0.1-beta.6"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "@rsbuild/core": "^1.0.1-beta.0"