Skip to content

Commit 9835723

Browse files
authored
Merge pull request #26 from react18-tools/fix-css-variable-rename
Fix-css-variable-rename
2 parents b001377 + 75b5617 commit 9835723

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

lib/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# esbuild-plugin-react18
22

3+
## 0.2.3
4+
5+
### Patch Changes
6+
7+
- Use negative lookbehind to avoid renaming css variables
8+
39
## 0.2.2
410

511
### Patch Changes

lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "esbuild-plugin-react18",
33
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
44
"private": false,
5-
"version": "0.2.2",
5+
"version": "0.2.3",
66
"description": "Unlock the Potential of React Server Components! Harness the power of an ESBuild plugin designed for crafting libraries compatible with RSC (React18 Server Components).",
77
"license": "MPL-2.0",
88
"main": "./dist/index.js",

lib/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function onEndCallBack(result: BuildResult, options: React18PluginOptions, write
173173
const v1 = jsxMatches[index]
174174
.replace(regExp2replace2GetVar, "")
175175
.replace(regExp2replace2GetVar0, "");
176-
txt = txt.replace(new RegExp(`\\b${v1}\\b`, "g"), importVarName);
176+
txt = txt.replace(new RegExp(`(?<!--)\\b${v1}\\b`, "g"), importVarName);
177177
}
178178
}
179179
}

0 commit comments

Comments
 (0)