-
Notifications
You must be signed in to change notification settings - Fork 12k
fix(@ngtools/webpack): Lazy load from node_modules #7659
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
Conversation
@@ -205,6 +206,9 @@ export class TypeScriptFileRefactor { | |||
} | |||
|
|||
transpile(compilerOptions: ts.CompilerOptions): TranspileOutput { | |||
if (this._fileName.endsWith('.d.ts') && this._fileName.indexOf('node_modules') > -1) { |
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.
You're not verifying that a path component is node_modules
, but just that node_modules
is a substring. Could you use something like this._fileName.split(path.sep).indexOf('node_modules') >= 0
?
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.
Thank you, you're right, I just fixed it.
Check if path is a library loaded from node_modules
So, what is missing to this PR be approved? |
We are also very interested in this PR. @hansl As your comment was take care of, Could this be merged? |
Glad to see this PR has been opened, it would be really nice to support this out of the box without additional Webpack config / loaders. |
Hi, I'm working with multiple custom libraries and this PR would be very useful for me and many others. |
This PR will be so helpful if it fix the issue, Can we have it with next build Thanks for the help |
@filipesilva any chance we can get it merged? |
Thank you for the contribution. However, this is being closed as it is outdated and no longer applies to the current code base. |
@clydin may I ask why it's no longer applicable? Are there now other ways to lazy load NgModules that live outside the app src? (i.e. inside an NPM package / node_modules) |
The changes in question were made to a file that no longer exists within the code base as it was used only for Angular versions less then 5. In addition the package in question has been moved to this repository: https://github.com/angular/devkit |
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. |
Based on code of PR #6609. Here's a possible solution for issue #6373