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
Conversation
@@ -102,6 +102,7 @@ export interface AngularCompilerPluginOptions { | |||
missingTranslation?: string; | |||
platform?: PLATFORM; | |||
nameLazyFiles?: boolean; | |||
lazyModulesResource?: string; |
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.
string | string[]
?
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.
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.
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.
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)); |
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.
realpath
might or might not play well with bazel and preserve-symlink
. Just want to make sure it's taken into account.
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.
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.
bf75794
to
3c70b49
Compare
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. |
3c70b49
to
aa0a676
Compare
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. |
Fix #12591