Skip to content

Commit

Permalink
Add code comment about the reason of removing CopyPlugin from webpack…
Browse files Browse the repository at this point in the history
… config.

Address #1339 (comment)
  • Loading branch information
eason9487 committed Mar 25, 2022
1 parent a455f0a commit 6dd5777
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ const webpackConfig = {
...defaultConfig.plugins.filter( ( plugin ) => {
const filteredPlugins = [
'DependencyExtractionWebpackPlugin',
/**
* We don't use block.json to build the client files.
* And CopyPlugin will cause any changes to files in the '<rootDir>/src' folder
* to trigger an unwanted webpack rebuild.
*
* Ref:
* - https://github.com/WordPress/gutenberg/tree/%40wordpress/scripts%4022.1.0/packages/scripts#default-webpack-config
* - https://github.com/WordPress/gutenberg/blob/%40wordpress/scripts%4022.1.0/packages/scripts/config/webpack.config.js#L232-L240
*/
'CopyPlugin',
];
return ! filteredPlugins.includes( plugin.constructor.name );
Expand Down

0 comments on commit 6dd5777

Please sign in to comment.