Skip to content

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