Skip to content

Commit

Permalink
Disable webpack perf hints when compiling packages (#57155)
Browse files Browse the repository at this point in the history
* Disable webpack perf hints when compiling packages

* Rewrite reduce to fromEntries in packages webpack config
  • Loading branch information
jsnajdr authored and artemiomorales committed Jan 4, 2024
1 parent 57daff2 commit 0f84551
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tools/webpack/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ],
Expand All @@ -142,8 +142,8 @@ module.exports = {
: undefined,
},
},
};
}, {} ),
] )
),
output: {
devtoolNamespace: 'wp',
filename: './build/[name]/index.min.js',
Expand All @@ -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 } ),
Expand Down

0 comments on commit 0f84551

Please sign in to comment.