@rsbuild/plugin-styled-components 1.2.0 → 1.2.2-beta.0
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/README.md +7 -1
- package/dist/index.cjs +3 -12
- package/dist/index.js +4 -6
- package/package.json +22 -23
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
An Rsbuild plugin to provide compile-time support for styled-components. It improves debugging and adds server-side rendering support for styled-components.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[styled-components](https://styled-components.com/) is a popular CSS-in-JS implementation library, which uses the new JavaScript feature [Tagged template](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) to write component CSS styles.
|
|
6
6
|
|
|
7
7
|
<p>
|
|
8
8
|
<a href="https://npmjs.com/package/@rsbuild/plugin-styled-components">
|
|
@@ -11,6 +11,12 @@ An Rsbuild plugin to provide compile-time support for styled-components. It impr
|
|
|
11
11
|
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
|
+
## Notice
|
|
15
|
+
|
|
16
|
+
This Rsbuild plugin is simply a wrapper for [@swc/plugin-styled-components](https://www.npmjs.com/package/@swc/plugin-styled-components).
|
|
17
|
+
|
|
18
|
+
If you have any requirements, it is recommended to file an issue to [SWC plugins repo](https://github.com/swc-project/plugins) or the styled-components repo.
|
|
19
|
+
|
|
14
20
|
## Usage
|
|
15
21
|
|
|
16
22
|
Install:
|
package/dist/index.cjs
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
const __rslib_import_meta_url__ = /*#__PURE__*/ function() {
|
|
3
3
|
return 'undefined' == typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
|
|
4
4
|
}();
|
|
5
|
-
// The require scope
|
|
6
5
|
var __webpack_require__ = {};
|
|
7
|
-
/************************************************************************/ // webpack/runtime/define_property_getters
|
|
8
6
|
(()=>{
|
|
9
7
|
__webpack_require__.d = function(exports1, definition) {
|
|
10
8
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -13,15 +11,12 @@ var __webpack_require__ = {};
|
|
|
13
11
|
});
|
|
14
12
|
};
|
|
15
13
|
})();
|
|
16
|
-
// webpack/runtime/has_own_property
|
|
17
14
|
(()=>{
|
|
18
15
|
__webpack_require__.o = function(obj, prop) {
|
|
19
16
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
20
17
|
};
|
|
21
18
|
})();
|
|
22
|
-
// webpack/runtime/make_namespace_object
|
|
23
19
|
(()=>{
|
|
24
|
-
// define __esModule on exports
|
|
25
20
|
__webpack_require__.r = function(exports1) {
|
|
26
21
|
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
27
22
|
value: 'Module'
|
|
@@ -31,13 +26,11 @@ var __webpack_require__ = {};
|
|
|
31
26
|
});
|
|
32
27
|
};
|
|
33
28
|
})();
|
|
34
|
-
|
|
35
|
-
// ESM COMPAT FLAG
|
|
29
|
+
var __webpack_exports__ = {};
|
|
36
30
|
__webpack_require__.r(__webpack_exports__);
|
|
37
|
-
// EXPORTS
|
|
38
31
|
__webpack_require__.d(__webpack_exports__, {
|
|
39
|
-
PLUGIN_STYLED_COMPONENTS_NAME: ()
|
|
40
|
-
pluginStyledComponents: ()
|
|
32
|
+
PLUGIN_STYLED_COMPONENTS_NAME: ()=>PLUGIN_STYLED_COMPONENTS_NAME,
|
|
33
|
+
pluginStyledComponents: ()=>pluginStyledComponents
|
|
41
34
|
});
|
|
42
35
|
const external_node_module_namespaceObject = require("node:module");
|
|
43
36
|
const external_reduce_configs_namespaceObject = require("reduce-configs");
|
|
@@ -47,8 +40,6 @@ function isServerTarget(target) {
|
|
|
47
40
|
}
|
|
48
41
|
const getDefaultStyledComponentsConfig = (isProd, ssr)=>({
|
|
49
42
|
ssr,
|
|
50
|
-
// "pure" is used to improve dead code elimination in production.
|
|
51
|
-
// we don't need to enable it in development because it will slow down the build process.
|
|
52
43
|
pure: isProd,
|
|
53
44
|
displayName: true,
|
|
54
45
|
transpileTemplateLiterals: true
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
const src_require = (0,
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__ from "reduce-configs";
|
|
3
|
+
const src_require = (0, __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__.createRequire)(import.meta.url);
|
|
4
4
|
function isServerTarget(target) {
|
|
5
5
|
return Array.isArray(target) ? target.includes('node') : 'node' === target;
|
|
6
6
|
}
|
|
7
7
|
const getDefaultStyledComponentsConfig = (isProd, ssr)=>({
|
|
8
8
|
ssr,
|
|
9
|
-
// "pure" is used to improve dead code elimination in production.
|
|
10
|
-
// we don't need to enable it in development because it will slow down the build process.
|
|
11
9
|
pure: isProd,
|
|
12
10
|
displayName: true,
|
|
13
11
|
transpileTemplateLiterals: true
|
|
@@ -19,7 +17,7 @@ const pluginStyledComponents = (pluginOptions = {})=>({
|
|
|
19
17
|
if ('webpack' === api.context.bundlerType) return;
|
|
20
18
|
const getMergedOptions = (useSSR, config)=>{
|
|
21
19
|
const isProd = 'production' === config.mode;
|
|
22
|
-
return (0,
|
|
20
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_reduce_configs_02786df6__.reduceConfigs)({
|
|
23
21
|
initial: getDefaultStyledComponentsConfig(isProd, useSSR),
|
|
24
22
|
config: pluginOptions
|
|
25
23
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsbuild/plugin-styled-components",
|
|
3
|
-
"version": "1.2.0",
|
|
3
|
+
"version": "1.2.2-beta.0",
|
|
4
4
|
"repository": "https://github.com/rspack-contrib/rsbuild-plugin-styled-components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,16 +14,9 @@
|
|
|
14
14
|
"main": "./dist/index.js",
|
|
15
15
|
"module": "./dist/index.mjs",
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
|
-
"files": [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"dev": "rslib build --watch",
|
|
21
|
-
"lint": "biome check .",
|
|
22
|
-
"lint:write": "biome check . --write",
|
|
23
|
-
"prepare": "simple-git-hooks && npm run build",
|
|
24
|
-
"test": "playwright test",
|
|
25
|
-
"bump": "npx bumpp"
|
|
26
|
-
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
27
20
|
"simple-git-hooks": {
|
|
28
21
|
"pre-commit": "npx nano-staged"
|
|
29
22
|
},
|
|
@@ -33,20 +26,20 @@
|
|
|
33
26
|
]
|
|
34
27
|
},
|
|
35
28
|
"dependencies": {
|
|
36
|
-
"@swc/plugin-styled-components": "
|
|
29
|
+
"@swc/plugin-styled-components": "6.7.0",
|
|
37
30
|
"reduce-configs": "^1.1.0"
|
|
38
31
|
},
|
|
39
32
|
"devDependencies": {
|
|
40
33
|
"@biomejs/biome": "^1.9.4",
|
|
41
|
-
"@playwright/test": "^1.
|
|
42
|
-
"@rsbuild/core": "^1.2.
|
|
43
|
-
"@rslib/core": "^0.
|
|
44
|
-
"@types/node": "^22.
|
|
34
|
+
"@playwright/test": "^1.50.1",
|
|
35
|
+
"@rsbuild/core": "^1.2.3",
|
|
36
|
+
"@rslib/core": "^0.4.0",
|
|
37
|
+
"@types/node": "^22.13.0",
|
|
45
38
|
"nano-staged": "^0.8.0",
|
|
46
|
-
"playwright": "^1.
|
|
39
|
+
"playwright": "^1.50.1",
|
|
47
40
|
"simple-git-hooks": "^2.11.1",
|
|
48
|
-
"styled-components": "^6.1.
|
|
49
|
-
"typescript": "^5.7.
|
|
41
|
+
"styled-components": "^6.1.14",
|
|
42
|
+
"typescript": "^5.7.3"
|
|
50
43
|
},
|
|
51
44
|
"peerDependencies": {
|
|
52
45
|
"@rsbuild/core": "^1.2.0"
|
|
@@ -56,10 +49,16 @@
|
|
|
56
49
|
"optional": true
|
|
57
50
|
}
|
|
58
51
|
},
|
|
59
|
-
"packageManager": "pnpm@9.14.4",
|
|
60
52
|
"publishConfig": {
|
|
61
53
|
"access": "public",
|
|
62
|
-
"registry": "https://registry.npmjs.org/"
|
|
63
|
-
|
|
54
|
+
"registry": "https://registry.npmjs.org/"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "rslib build",
|
|
58
|
+
"dev": "rslib build --watch",
|
|
59
|
+
"lint": "biome check .",
|
|
60
|
+
"lint:write": "biome check . --write",
|
|
61
|
+
"test": "playwright test",
|
|
62
|
+
"bump": "npx bumpp"
|
|
64
63
|
}
|
|
65
|
-
}
|
|
64
|
+
}
|