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

feat(@ngtools/webpack): allow custom lazy module resource #12593

Merged
merged 1 commit into from Nov 8, 2018

Conversation

filipesilva
Copy link
Contributor

Fix #12591

@filipesilva filipesilva added the needs: discussion On the agenda for team meeting to determine next steps label Nov 2, 2018
@@ -102,6 +102,7 @@ export interface AngularCompilerPluginOptions {
missingTranslation?: string;
platform?: PLATFORM;
nameLazyFiles?: boolean;
lazyModulesResource?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

string | string[]?

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'm unsure what the final semantics here should be. Should we allow several extra lazy module resources? Each would be a file containing a loader and it will have all the lazy modules as context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed it always be an array.

// versions (until the dynamic import appears outside of core I suppose).
// We resolve any symbolic links in order to get the real path that would be used in webpack.
const angularCorePackagePath = require.resolve('@angular/core/package.json');
const angularCoreResourceRoot = fs.realpathSync(path.dirname(angularCorePackagePath));
Copy link
Contributor

Choose a reason for hiding this comment

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

realpath might or might not play well with bazel and preserve-symlink. Just want to make sure it's taken into account.

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 think it should be ok since it's the realpath to a file that was already resolved via require.resolve (thus using Bazel resolution). It's also the same logic as before though, so this change isn't breaking that.

@filipesilva filipesilva removed state: WIP needs: discussion On the agenda for team meeting to determine next steps labels Nov 8, 2018
@filipesilva filipesilva added the target: major This PR is targeted for the next major release label Nov 8, 2018
@filipesilva
Copy link
Contributor Author

We should consider exposing this via an CLI build option in the future. It can help in cases where you have your own resource loader, like custom routers.

@filipesilva filipesilva removed the request for review from hansl November 8, 2018 17:46
@vikerman vikerman merged commit 5150f82 into angular:master Nov 8, 2018
@filipesilva filipesilva deleted the lazy-module-resources branch November 8, 2018 18:36
@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
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants