Skip to content

Commit aaad539

Browse files
author
Micah Zoltu
authored
Fixes bug in grid-areas.
I don't really understand why the build is doing name mangling of classes and grid areas, but it appears there is already some code to deal with it. Unfortunately, that code doesn't work as *sometimes* the name mangler is including a leading `_` and sometimes it is not. Luckily, the fix is easy, just include support for an optional leading `_` in the existing regexp.
1 parent e4dd359 commit aaad539

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/build-plugins/esbuild-plugins.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export function cssModules() {
232232

233233
// Fix CSS grid areas treated as local
234234
css = css
235-
.replaceAll(/grid-area:\s+[^_]+_(.*?);$/gm, (m, g) => {
235+
.replaceAll(/grid-area:\s+_?[^_]+_(.*?);$/gm, (m, g) => {
236236
return `grid-area: ${g};`;
237237
})
238238
.replaceAll(/\s["][^"']+_([^"']+)["]/g, (m, g) => {

0 commit comments

Comments
 (0)