Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 1.75 MB ℹ️ View Unchanged
|
sirreal
left a comment
There was a problem hiding this comment.
Nice, let's give it a try. Thanks!
|
I noticed Core doesn't have this, shall we set it there as well @desrosj? https://github.com/WordPress/wordpress-develop/blob/trunk/.npmrc |
This change was applied in Gutenberg: WordPress/gutenberg#61630 Quoting that : > The `npm dedupe` command searches > and attempts to simplify the overall structure of the local package > tree to allow dependent packages to be shared more effectively. As > detailed in #61532, reducing the amount of dependency duplication is > beneficial for a few reasons: > > - Fewer packages overall. > - Faster installation. > - Less size to transfer and store on disk. > - Usually bundle size is reduced (although this depends on which > versions of packages are used). > > However, unless the command is run regularly, the project's dependency > tree easily falls out of order. See https://docs.npmjs.com/cli/v10/commands/npm-dedupe
|
I created WordPress/wordpress-develop#7537 to add the config. |
What?
This sets
prefer-dedupetotruein the.npmrcfile.See discussions in #61486 and #61532.
Why?
The
npm dedupecommand searches and attempts to simplify the overall structure of the local package tree to allow dependent packages to be shared more effectively. As detailed in #61532, reducing the amount of dependency duplication is beneficial for a few reasons:However, unless the command is run regularly, the project's dependency tree easily falls out of order.
How?
By configuring
prefer-dedupe, npm should avoid duplication as much as possible by default.This also includes one more
npm deduperun. In my testing, adding the value to the.npmrcdid not retroactively apply the policy (unless I've not correctly configured the setting here).