Skip to content

Commit

Permalink
Merge pull request #26 from react18-tools/fix-css-variable-rename
Browse files Browse the repository at this point in the history
Fix-css-variable-rename
  • Loading branch information
mayank1513 authored May 28, 2024
2 parents b001377 + 75b5617 commit 9835723
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# esbuild-plugin-react18

## 0.2.3

### Patch Changes

- Use negative lookbehind to avoid renaming css variables

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "esbuild-plugin-react18",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"private": false,
"version": "0.2.2",
"version": "0.2.3",
"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).",
"license": "MPL-2.0",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function onEndCallBack(result: BuildResult, options: React18PluginOptions, write
const v1 = jsxMatches[index]
.replace(regExp2replace2GetVar, "")
.replace(regExp2replace2GetVar0, "");
txt = txt.replace(new RegExp(`\\b${v1}\\b`, "g"), importVarName);
txt = txt.replace(new RegExp(`(?<!--)\\b${v1}\\b`, "g"), importVarName);
}
}
}
Expand Down

0 comments on commit 9835723

Please sign in to comment.