-
Notifications
You must be signed in to change notification settings - Fork 32
Feature: Path alias replacement #15
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
Conversation
6607919
to
32d8b72
Compare
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.
Excellent, LGTM 👍
tools/scripts/replaceAlias.ts
Outdated
}; | ||
|
||
content = content.replace(requireRegex(packageName), replacePath); | ||
content = content.replace(importRegex(packageName), (s, _, matched) => |
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.
After I check the MDN replace and another example, seems the matched is the first argument and original string is the latest argument, should we check it again?
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.
You're right! I updated the variable name, but the logic was correct~
e878082
to
20a8dce
Compare
32d8b72
to
48db8eb
Compare
48db8eb
to
67598d7
Compare
@kokokuo I've fixed the issues. |
I created a simple script to replace the alias import such as "@vulcan/core/container" with relative pathes.
before
after