From 46058c01df66604256cba8986f471ba789b0d9a2 Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Mon, 18 Dec 2023 12:30:12 +0100 Subject: [PATCH 1/2] Disable webpack perf hints when compiling packages --- tools/webpack/packages.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index 86554d5f13909..f03920ec42065 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -157,6 +157,9 @@ module.exports = { return `webpack://${ info.namespace }/${ info.resourcePath }`; }, }, + performance: { + hints: false, // disable warnings about package sizes + }, plugins: [ ...plugins, new DependencyExtractionWebpackPlugin( { injectPolyfill: true } ), From 203c461fd579925d8ba80eee70b77a19bc6569e5 Mon Sep 17 00:00:00 2001 From: Jarda Snajdr Date: Mon, 18 Dec 2023 12:30:57 +0100 Subject: [PATCH 2/2] Rewrite reduce to fromEntries in packages webpack config --- tools/webpack/packages.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/webpack/packages.js b/tools/webpack/packages.js index f03920ec42065..1bbe63f064c30 100644 --- a/tools/webpack/packages.js +++ b/tools/webpack/packages.js @@ -129,10 +129,10 @@ const vendorsCopyConfig = Object.entries( vendors ).flatMap( module.exports = { ...baseConfig, name: 'packages', - entry: gutenbergPackages.reduce( ( memo, packageName ) => { - return { - ...memo, - [ packageName ]: { + entry: Object.fromEntries( + gutenbergPackages.map( ( packageName ) => [ + packageName, + { import: `./packages/${ packageName }`, library: { name: [ 'wp', camelCaseDash( packageName ) ], @@ -142,8 +142,8 @@ module.exports = { : undefined, }, }, - }; - }, {} ), + ] ) + ), output: { devtoolNamespace: 'wp', filename: './build/[name]/index.min.js',