rollup-plugin-react-scoped-css 1.0.0-alpha.13 → 1.0.0-alpha.14
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 +2 -2
- package/dist/index.js +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
While using react in a professional context, I realized that it was lacking the scopped css feature that I learned to love from Vue and Angular. After some reasearch I came across good plugins, but sadly were not compatible with vite and/or rollup. Thus, I decided to create this plugin which was greatly inspired by the amazing work of [gaoxiaoliangz](https://github.com/gaoxiaoliangz) with his [react-scoped-css plugin](https://github.com/gaoxiaoliangz/react-scoped-css).
|
|
5
5
|
|
|
6
6
|
## Requirements
|
|
7
|
-
+ **node** >=
|
|
8
|
-
+ **vite** >=
|
|
7
|
+
+ **node** >= 18
|
|
8
|
+
+ **vite** >= 5
|
|
9
9
|
|
|
10
10
|
## How to install
|
|
11
11
|
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,8 @@ function reactScopedCssPlugin(optionsIn = {}) {
|
|
|
70
70
|
? `data-${options.hashPrefix}-${importerHash}`
|
|
71
71
|
: `data-${importerHash}`;
|
|
72
72
|
const newAst = (0, ast_program_1.addHashAttributesToJsxTagsAst)(program, scopedAttr);
|
|
73
|
-
|
|
73
|
+
const newCode = (0, escodegen_1.generate)(newAst);
|
|
74
|
+
return newCode;
|
|
74
75
|
}
|
|
75
76
|
if (scopedCssRegex.test(getFilenameFromPath(id))) {
|
|
76
77
|
const importerHash = getHashFromPath(id);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rollup-plugin-react-scoped-css",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.14",
|
|
4
4
|
"description": "A rollup plugin designed to allow scoped css to be run in react (Compatible with vite and rollup)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/cmseguin/rollup-plugin-react-scoped-css#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@rollup/pluginutils": "5.0
|
|
37
|
+
"@rollup/pluginutils": "5.1.0",
|
|
38
38
|
"css-tree": "2.3.1",
|
|
39
39
|
"escodegen": "2.0.0",
|
|
40
40
|
"js-xxhash": "2.0.0",
|
|
41
|
-
"rollup": "
|
|
41
|
+
"rollup": "4.6.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@babel/core": "7.20.12",
|