-
Notifications
You must be signed in to change notification settings - Fork 114
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
feat: add util function to generate module paths #763
Conversation
🦋 Changeset detectedLatest commit: 6481f3b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR! The logic is sound 🎉, we just need to work on the API and simplify the tests a little bit, see the comments below
@jbroma Pushed the requested changes! Let me know what you think about the new test structure. I separated it into logical tests (classic, exotic, backslashes) and think it's much better. Although I had to do some massaging in the regex array returned from the function to be able to have some more scalable tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
Thank you for working on this @thiagobrez, very useful stuff 🔥 |
Summary
This PR introduces the
getModulePaths
util function, to generate module path regexes for both classic (npm, yarn) and exotic (pnpm) paths, to be used in the bundler config fileinclude
rules.This function will be available for both internal and public use.
Test plan
Tests to classic and exotic module paths are included, also taking in consideration nested packages and backslashes from Windows systems.