-
Notifications
You must be signed in to change notification settings - Fork 14
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
Knip - Production mode #6676
Knip - Production mode #6676
Conversation
Size Change: -24 B (0%) Total Size: 2.19 MB ℹ️ View Unchanged
|
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.
👏 Great!
@@ -1,11 +1,11 @@ | |||
const entryPoints = require('../webpack.entryPoints').common; | |||
|
|||
const flattenedEntryPoints = [...Object.keys(entryPoints)].map( | |||
(key) => `assets/${entryPoints[key]}`, | |||
(key) => `assets/${entryPoints[key]}!`, |
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.
So the !
here is a signal to knip that this is production code?
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.
Exactly, is it worth a comment or link?
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.
Yeah I think a comment/link would be good 👍
Seen on PROD (merged by @andrewHEguardian 9 minutes and 42 seconds ago)
Sentry Release: support-client-side, support |
What are you doing in this PR?
Remove unused code found using knip in production mode, and add our entry points as the production code using the
!
syntax. This reveals code used only by tests, obviously some of these are necessary (eg mocks) so we shouldn't run our GHA in production mode.How to test
Run
yarn knip --production
- see files and dependencies used by tests