Skip to content

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

Closed
wants to merge 2 commits into from
Closed

fix(@ngtools/webpack): Lazy load from node_modules #7659

wants to merge 2 commits into from

Conversation

pedroapy
Copy link

Based on code of PR #6609. Here's a possible solution for issue #6373

@@ -205,6 +206,9 @@ export class TypeScriptFileRefactor {
}

transpile(compilerOptions: ts.CompilerOptions): TranspileOutput {
if (this._fileName.endsWith('.d.ts') && this._fileName.indexOf('node_modules') > -1) {
Copy link
Contributor

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?

Copy link
Author

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.

pedroapy added 2 commits September 13, 2017 19:47
Based on PR #6609. Here's a possible solution for issue #6373
Check if path is a library loaded from node_modules
@rhinoandre
Copy link

So, what is missing to this PR be approved?

@choeller
Copy link

choeller commented Dec 7, 2017

We are also very interested in this PR. @hansl As your comment was take care of, Could this be merged?

@mmayors
Copy link

mmayors commented Jan 17, 2018

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.

@andresguibarra
Copy link

Hi, I'm working with multiple custom libraries and this PR would be very useful for me and many others.

@smkart
Copy link

smkart commented Mar 19, 2018

This PR will be so helpful if it fix the issue, Can we have it with next build

Thanks for the help

@dotansimha
Copy link

@pedroapy @hansl any chance we can get it merged? :(

@andresguibarra
Copy link

@filipesilva any chance we can get it merged?

@clydin
Copy link
Member

clydin commented Mar 28, 2018

Thank you for the contribution. However, this is being closed as it is outdated and no longer applies to the current code base.

@clydin clydin closed this Mar 28, 2018
@mmayors
Copy link

mmayors commented Apr 5, 2018

@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)

@clydin
Copy link
Member

clydin commented Apr 5, 2018

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

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.