From 5929b9374f362bd950e3d049a8cf0e7afe637e6b Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Tue, 8 Oct 2024 10:19:38 +0200 Subject: [PATCH] Set prefer-dedupe true in npm configuration This change was applied in Gutenberg: https://github.com/WordPress/gutenberg/pull/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 --- .npmrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.npmrc b/.npmrc index cd7566c820233..7a346f877b931 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,4 @@ save-exact = true engine-strict = true legacy-peer-deps = true +prefer-dedupe = true