Skip to content

adjust HAS_IMPORT regex #1062

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

Merged
merged 2 commits into from
Sep 30, 2024
Merged

adjust HAS_IMPORT regex #1062

merged 2 commits into from
Sep 30, 2024

Conversation

manmen-mi
Copy link

@manmen-mi manmen-mi commented Sep 30, 2024

fix #1060

match RegExp HAS_IMPORT with fileMayBeTailwindRelated()


let HAS_IMPORT = /@import\s*('[^']+'|"[^"]+");/
let HAS_IMPORT = /@import\s*['"]/ // from fileMayBeTailwindRelated()

It seemed like the regex only accepted @import '~~~';, so @import '~~~' layer(xxx); did not match.
Therefore, I loosened the regex of HAS_IMPORT a bit so that it would match the other parts.

translated from japanese

@thecrypticace
Copy link
Contributor

oops… lol. Thanks for the PR and the tests 💯

@thecrypticace thecrypticace merged commit 83cccdb into tailwindlabs:main Sep 30, 2024
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.

IntelliSense doesn't initialize project without @import 'tailwindcss'
3 participants