-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(webpack): allow transpiling package in nested node_modules
#8205
Conversation
When I need to transpile `/lowlight/node_modules/highlight.js/...` but not transpile `/lowlight/` itself, it is imposible, because split only return text between `node_modules` ( `/lowlight/` in this example) this change leave full path after first `node_modules`, not only path between 2 `node_modules`
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.
The change look OK.
But I think we need to consider it this is a proper fix in your scenario, I think a bigger issue from your description is: your app is having inconsistent version of highlight.js
, so highlight.js
is installed under lowlight/node_modules
.
I suggest adding highlight.js
to dependencies explicitly and remove inconsistent version, then highlight.js
will be installled under node_modules
@clarkdo
we need both this packages, and they are not using same version, so npm install one of them to nested node_modules (standard behavior) |
Sorry, what I mean is we should always add dependencies explicitly. Like your case, if you're using |
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.
Change seems good. Still it is highly recommended to explicitly include dependencies in package.json
. Since there is no proper reproduction, if it makes regressions we may need to revert in a patch.
node_modules
Types of changes
Description
When I need to transpile
[PROJECT_PATH]/node_modules/lowlight/node_modules/highlight.js/...
but not transpile/lowlight/
itself, it is imposible, because split only return text betweennode_modules
(/lowlight/
in this example)this change leave full path after first
node_modules
, not only path between 2node_modules
(/lowlight/node_modules/highlight.js/...
in this example)Checklist: