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

fix(AoTPlugin): don't override context module deps #4153

Merged
merged 2 commits into from
Jan 22, 2017

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Jan 21, 2017

Thanks to @clydin for a much cleaner solution!

Fix #2496
Fix #3079

})
// Check for AoT and lazy routes.
.then(() => ng('build', '--aot'))
.then(() => readdirSync('dist').length)
.then(currentNumberOfDistFiles => {
if (oldNumberOfFiles >= currentNumberOfDistFiles) {
if (oldNumberOfFiles != currentNumberOfDistFiles) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old number of files should be smaller, so I think this change is unneeded (and can lead to errors)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now update the number: oldNumberOfFiles = currentNumberOfDistFiles;.

result.resolveDependencies = createResolveDependenciesFromContextMap(
(_: any, cb: any) => cb(null, this._lazyRoutes));

// there is no way to find the original request, so try to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use a special property set by the function above, that should work, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, tried that. It's a whole new object with just a few props picked. Tried a bunch of stuff even. Also checked with @TheLarkInn, he didn't know of a way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Clydins approach does away with this entirely, and makes it possible to always target the right resource.

@born2net
Copy link

sweet, need to wait or the next NPM build to test this?

regards

@filipesilva
Copy link
Contributor Author

@born2net after it is accepted, yes. You can also use master if you want.

@born2net
Copy link

tx man appreciate the efforts

@hansl
Copy link
Contributor

hansl commented Jan 22, 2017

LGTM, looks much better!

@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 11, 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.

Dynamically require module Lazy loading is not working together with 'import *' syntax
4 participants