Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transformer variant group changes regular expressions #3206

Closed
4 tasks done
schelmo opened this issue Oct 9, 2023 · 1 comment · May be fixed by #3211
Closed
4 tasks done

transformer variant group changes regular expressions #3206

schelmo opened this issue Oct 9, 2023 · 1 comment · May be fixed by #3211
Labels

Comments

@schelmo
Copy link
Contributor

schelmo commented Oct 9, 2023

UnoCSS version

0.56.5

Describe the bug

when using the variant group transformer and including js/ts files in your unocss pipeline like:

UnoCSS({
  content: {
    pipeline: {
      include: [
        /\.(vue|svelte|[jt]sx?|mdx?|astro|elm|php|phtml|html)($|\?)/,
      ],
    },
  }
})

unocss is changing the regular expressions with brackets in it.
like the camelizeRE from vue

var camelizeRE = /-(\w)/g;

becomes:

var camelizeRE = /-\w/g;

this happens also with user code:
checkout out App.vue in the reproduction and watch the Browser console
the brackets gets eliminated from the regular expression

for the vuejs transformations, watch the stackblitz console and then comment out the

transformers: [transformerVariantGroup()],

line

Reproduction

https://stackblitz.com/edit/unocss-unocss-krecms?file=src%2FApp.vue,vite.config.ts,src%2Fmain.ts

System Info

No response

Validations

Copy link

stale bot commented Dec 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 8, 2023
@stale stale bot closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant