-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
Track Angular polyfills #913
Conversation
commit: |
6753510
to
0c75e54
Compare
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.
Thanks David! One note I have.
"polyfills": [ | ||
"zone.js" | ||
], | ||
"polyfills": "src/polyfill.js", |
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.
Are polyfills potentially external? I.e. the zone.js
example might be a package reference, which should then go into toDeferResolve
. Knip will try to resolve the specifier and mark the external dependency as (un)used or use the internal path as an entry file.
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.
Absolutely! They may be external. Just pushed 1a78aae to take that into account. Just out of curiosity, what's the difference between toDeferResolve
and toDeferResolveEntry
? 🤔
Thanks :)
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.
Checked also that no other option allows for external imports. At least for the application
builder https://github.com/angular/angular-cli/blob/main/packages/angular/build/src/builders/application/schema.json#L78 but from what I can't recall that's the same behaviour for previous builders too
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.
Absolutely! They may be external. Just pushed 1a78aae to take that into account. Just out of curiosity, what's the difference between
toDeferResolve
andtoDeferResolveEntry
? 🤔Thanks :)
The fact that I had to look this up isn't great 😅
toDeferResolve
: needs, resolving, reported as unresolved if that's the casetoDeferResolveEntry
: needs resolving, meant as entry file, ignored if file doesn't existtoEntry
: doesn't need extra resolving, ignored if file doesn't exist
Will try to come up with better names/docs. Suggestions welcome :)
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.
hahah naming is hard! thanks for looking it up 😊 can't think of better ones rn :S
As suggested by @webpro
https://github.com/webpro-nl/knip/actions/runs/12816992432/job/35739213460 failed but doesn't seem related to this change |
🚀 This pull request is included in v5.42.2. See Release 5.42.2 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
Tracks Angular polyfills build option
Bears in mind that either an array or a string can be passed as option in browser, karma and browser ESBuild builders. In the newer application builder, just an array can be passed though.