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

Don't install peerDependencies which can be resolved by Webpack #96

Open
insin opened this issue Jan 13, 2017 · 2 comments
Open

Don't install peerDependencies which can be resolved by Webpack #96

insin opened this issue Jan 13, 2017 · 2 comments

Comments

@insin
Copy link
Collaborator

insin commented Jan 13, 2017

If peerDependencies were handled like any other normal module the plugin tries to install and Webpack was able to resolve the package name, they wouldn't be installed.

e.g. when you're using compatibility layers like preact-compat or inferno-compat, they're aliased to 'react', so you don't want the real React to be installed if you import a React component which has React as a peerDependency.

@insin insin changed the title Option to ignore specific peer dependencies Don't install peerDependencies which can be resolved by Webpack Jan 16, 2017
@insin
Copy link
Collaborator Author

insin commented Jan 23, 2017

Relevant from the closed PR:

If, instead of being installed up-front, peerDependencies were handled like any other normal module the plugin tries to install and Webpack was able to resolve them package via aliases, fallback module directories etc. they wouldn't be installed.

We can't ignore peerDependencies because Plugin#resolveModule() skips sub-dependencies - could install() return something the plugin could use to check if it should attempt to resolve/install sub-dependencies which are known to be peerDependencies?

@insin
Copy link
Collaborator Author

insin commented Jan 24, 2017

Anyone got a module which demonstrates a solid use case for needing to install peerDependencies?

I have a build which disables up-front installation and has lots of debug logging to show what's going on, and it works just fine in example/webpack2 and my nwb preact case.

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

No branches or pull requests

1 participant