@rsbuild/plugin-styled-components 0.3.0 → 0.3.1
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.js +7 -11
- package/dist/index.mjs +8 -11
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ var import_shared = require("@rsbuild/shared");
|
|
|
27
27
|
var pluginStyledComponents = (userConfig = {}) => ({
|
|
28
28
|
name: "rsbuild:styled-components",
|
|
29
29
|
setup(api) {
|
|
30
|
-
api.modifyBundlerChain(async (chain, {
|
|
30
|
+
api.modifyBundlerChain(async (chain, { isProd }) => {
|
|
31
31
|
const { bundlerType } = api.context;
|
|
32
32
|
if (bundlerType === "webpack") {
|
|
33
33
|
return;
|
|
@@ -40,16 +40,12 @@ var pluginStyledComponents = (userConfig = {}) => ({
|
|
|
40
40
|
if (!styledComponentsOptions) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
options.rspackExperiments.styledComponents = styledComponentsOptions;
|
|
50
|
-
return options;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
43
|
+
(0, import_shared.modifySwcLoaderOptions)({
|
|
44
|
+
chain,
|
|
45
|
+
modifier: (options) => {
|
|
46
|
+
options.rspackExperiments ?? (options.rspackExperiments = {});
|
|
47
|
+
options.rspackExperiments.styledComponents = styledComponentsOptions;
|
|
48
|
+
return options;
|
|
53
49
|
}
|
|
54
50
|
});
|
|
55
51
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -10,12 +10,13 @@ global.require = createRequire(import.meta.url);
|
|
|
10
10
|
import {
|
|
11
11
|
isServerTarget,
|
|
12
12
|
mergeChainedOptions,
|
|
13
|
+
modifySwcLoaderOptions,
|
|
13
14
|
getDefaultStyledComponentsConfig
|
|
14
15
|
} from "@rsbuild/shared";
|
|
15
16
|
var pluginStyledComponents = (userConfig = {}) => ({
|
|
16
17
|
name: "rsbuild:styled-components",
|
|
17
18
|
setup(api) {
|
|
18
|
-
api.modifyBundlerChain(async (chain, {
|
|
19
|
+
api.modifyBundlerChain(async (chain, { isProd }) => {
|
|
19
20
|
const { bundlerType } = api.context;
|
|
20
21
|
if (bundlerType === "webpack") {
|
|
21
22
|
return;
|
|
@@ -28,16 +29,12 @@ var pluginStyledComponents = (userConfig = {}) => ({
|
|
|
28
29
|
if (!styledComponentsOptions) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
options.rspackExperiments.styledComponents = styledComponentsOptions;
|
|
38
|
-
return options;
|
|
39
|
-
});
|
|
40
|
-
}
|
|
32
|
+
modifySwcLoaderOptions({
|
|
33
|
+
chain,
|
|
34
|
+
modifier: (options) => {
|
|
35
|
+
options.rspackExperiments ?? (options.rspackExperiments = {});
|
|
36
|
+
options.rspackExperiments.styledComponents = styledComponentsOptions;
|
|
37
|
+
return options;
|
|
41
38
|
}
|
|
42
39
|
});
|
|
43
40
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-styled-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
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
|
-
"@rsbuild/shared": "0.3.
|
|
25
|
+
"@rsbuild/shared": "0.3.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "16.x",
|
|
29
29
|
"typescript": "^5.3.0",
|
|
30
|
-
"@
|
|
31
|
-
"@rsbuild/core": "0.3.
|
|
30
|
+
"@scripts/test-helper": "1.0.0",
|
|
31
|
+
"@rsbuild/core": "0.3.1"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public",
|