fix(#1875): Support npm linked libraries#2291
fix(#1875): Support npm linked libraries#2291filipesilva merged 1 commit intoangular:masterfrom serhiisol:support-npm-linked-packages
Conversation
|
@TheLarkInn can you review? |
|
The new equivalent of |
|
@filipesilva, this PR replaces the module resolution whereas the webpack recommended config adds a fallback. |
|
@clydin, good eye, thanks for the heads-up! |
| resolve: { | ||
| extensions: ['.ts', '.js'] | ||
| extensions: ['.ts', '.js'], | ||
| modules: [ path.join(projectRoot, 'node_modules') ] |
There was a problem hiding this comment.
Could you use modules: ['node_modules', path.resolve(projectRoot, 'node_modules')] instead to have a fallback?
There was a problem hiding this comment.
@filipesilva, @serhiisol: FYI: when I use
modules: ['node_modules', path.resolve(projectRoot, 'node_modules')]
it does not work, while when I use
modules: [ path.join(projectRoot, 'node_modules') ]
it does :)
There was a problem hiding this comment.
@clydin, not needed, @serhiisol gave the right modification
There was a problem hiding this comment.
@TheLarkInn can you weigh as a webpack core member?
There was a problem hiding this comment.
modules: [ path.join(projectRoot, 'node_modules') ] is correct. Requires absolute path to module directory as described.
There was a problem hiding this comment.
Sync branch with master and LGTM pending CI.
|
Waiting for CI but added approval. |
This patch fixes support for npm linked libraries. More information can be found at angular/angular-cli#2291
This patch fixes support for npm linked libraries. More information can be found at angular/angular-cli#2291
|
Hi all, I'm also having this error but I don't use webpack, instead I use SystemJS and Vagrant. Do you know how I could emulate the fix you mentioned for these instead? Basically doing this:
But for people not using Webpack. Thank you for your help! |
|
It seems we also need this fix in webpack-build-test file. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR fixes the problem with linked packages (#1875).
Originally I've used http://webpack.github.io/docs/troubleshooting.html#npm-linked-modules-doesn-t-find-their-dependencies official documentation. But for webpack2 the team has changed also configuration object, which doesn't work like described in the article.
So I've found another release note related to configuration object - https://gist.github.com/sokra/27b24881210b56bbaff7#resolving-options
The most important is
Resolving optionssection.So we have to change our configuration object from:
to:
Closes #1875