Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.4

### Patch Changes

- Do not remove ';' when require statement starts with ','.

## 0.2.3

### 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.3",
"version": "0.2.4",
"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
3 changes: 2 additions & 1 deletion lib/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ function onEndCallBack(result: BuildResult, options: React18PluginOptions, write
for (let index = 1; index < jsxMatches.length; index++) {
let token = jsxMatches[index];
if (/^,.*,$/.test(token)) token = token.slice(1);
else if (token.startsWith("var ") && token.endsWith(",")) token = token.slice(4);
else if (/^,.*;$/.test(token)) token = token.replace(";", "");
else if (/^var .*,$/.test(token)) token = token.slice(4);
txt = txt.replace(token, "");
const v1 = jsxMatches[index]
.replace(regExp2replace2GetVar, "")
Expand Down