@rsbuild/plugin-styled-components 0.7.0-beta.3 → 0.7.0-beta.4
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 +11 -1
- package/dist/index.js +10 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -24,6 +24,16 @@ __export(src_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
26
|
var import_shared = require("@rsbuild/shared");
|
|
27
|
+
var getDefaultStyledComponentsConfig = (isProd, ssr) => {
|
|
28
|
+
return {
|
|
29
|
+
ssr,
|
|
30
|
+
// "pure" is used to improve dead code elimination in production.
|
|
31
|
+
// we don't need to enable it in development because it will slow down the build process.
|
|
32
|
+
pure: isProd,
|
|
33
|
+
displayName: true,
|
|
34
|
+
transpileTemplateLiterals: true
|
|
35
|
+
};
|
|
36
|
+
};
|
|
27
37
|
var pluginStyledComponents = (pluginOptions = {}) => ({
|
|
28
38
|
name: "rsbuild:styled-components",
|
|
29
39
|
setup(api) {
|
|
@@ -34,7 +44,7 @@ var pluginStyledComponents = (pluginOptions = {}) => ({
|
|
|
34
44
|
const useSSR = (0, import_shared.isServerTarget)(api.context.targets);
|
|
35
45
|
const isProd = (0, import_shared.getNodeEnv)() === "production";
|
|
36
46
|
return (0, import_shared.mergeChainedOptions)({
|
|
37
|
-
defaults:
|
|
47
|
+
defaults: getDefaultStyledComponentsConfig(isProd, useSSR),
|
|
38
48
|
options: pluginOptions
|
|
39
49
|
});
|
|
40
50
|
};
|
package/dist/index.js
CHANGED
|
@@ -8,11 +8,20 @@ import path from "path";
|
|
|
8
8
|
|
|
9
9
|
// src/index.ts
|
|
10
10
|
import {
|
|
11
|
-
getDefaultStyledComponentsConfig,
|
|
12
11
|
getNodeEnv,
|
|
13
12
|
isServerTarget,
|
|
14
13
|
mergeChainedOptions
|
|
15
14
|
} from "@rsbuild/shared";
|
|
15
|
+
var getDefaultStyledComponentsConfig = (isProd, ssr) => {
|
|
16
|
+
return {
|
|
17
|
+
ssr,
|
|
18
|
+
// "pure" is used to improve dead code elimination in production.
|
|
19
|
+
// we don't need to enable it in development because it will slow down the build process.
|
|
20
|
+
pure: isProd,
|
|
21
|
+
displayName: true,
|
|
22
|
+
transpileTemplateLiterals: true
|
|
23
|
+
};
|
|
24
|
+
};
|
|
16
25
|
var pluginStyledComponents = (pluginOptions = {}) => ({
|
|
17
26
|
name: "rsbuild:styled-components",
|
|
18
27
|
setup(api) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-styled-components",
|
|
3
|
-
"version": "0.7.0-beta.
|
|
3
|
+
"version": "0.7.0-beta.4",
|
|
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.0-beta.
|
|
25
|
+
"@rsbuild/shared": "0.7.0-beta.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "18.x",
|
|
29
29
|
"typescript": "^5.4.2",
|
|
30
|
-
"@rsbuild/core": "0.7.0-beta.
|
|
30
|
+
"@rsbuild/core": "0.7.0-beta.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@rsbuild/core": "^0.7.0-beta.
|
|
33
|
+
"@rsbuild/core": "^0.7.0-beta.4"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public",
|