Skip to content

Commit 72b9416

Browse files
committed
fix CSS variables renaming
fixes #25 Use negative lookbahind
1 parent b001377 commit 72b9416

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)