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

Fix tag extraction for React projects #297

Closed
wants to merge 5 commits into from
Closed

Fix tag extraction for React projects #297

wants to merge 5 commits into from

Conversation

hrishikesh-k
Copy link
Contributor

WindiCSS (with React + Vite), was failing to detect my attributes in the following code:

<input
  onChange = {event => props.model[1](props.model[0], event.target.value)}
  type = {inputData.toggle ? 'text' : props.type}
  value = {props.data}
  w-bg = "white dark:black"
  w-border = {borderStyle()}
  w-font = "leading-none"
  w-h = "10"
  w-outline = "none"
  w-p = {props.type === 'password' ? 'l-10 r-17.5' : 'x-10' + ' y-2'}
  w-w = "full"/>

When I checked, it seemed to be failing at this line: https://github.com/windicss/vite-plugin-windicss/blob/main/packages/plugin-utils/src/extractors/default.ts#L12

The current regex here: https://github.com/windicss/vite-plugin-windicss/blob/main/packages/plugin-utils/src/regexes.ts#L2 stops detecting at:

<input
  onChange = {event =>

So, it has been modified to ignore the =.

@hrishikesh-k
Copy link
Contributor Author

I'm not sure how to fix the tests :/

The ones using Node 12 seem to be failing due to optional chaining being used somewhere and it's not supported in Node 12. But not sure what to do about the Node 14 ones.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants