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 for imports #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix for imports #66

wants to merge 1 commit into from

Conversation

Dewscntd
Copy link

No description provided.

Copy link
Owner

@nivekcode nivekcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Dewscntd thx a lot for this PR. I think your changes would break many use cases. So usually npm modules are imported without a prefix for example 'lodash' and never with node_modules

@Dewscntd
Copy link
Author

Dewscntd commented Dec 9, 2021

Hi @kreuzerk , sorry for the late response and thanks for the reply...
so require.resolve(libName) always return the full path of the specific library (tested on mac & windows using node v14.15) therefore it will always include / (unless it's on windows and then it will have \ ).
adding includes(node_modules) ensure that it is a real third party regardless the os and clean the local imports.

@nivekcode
Copy link
Owner

@Dewscntd thx for the explanation. You are right. That makes perfect sense.

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.

2 participants