From 242aeb10876e71d5a94cbb80812de818ee9d68f9 Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Fri, 11 Feb 2022 02:40:02 -0500 Subject: [PATCH] Scripts: Copy PHP files from `src` into `build` (#38715) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Copy any .php files to the build folder. * Add CHANGELOG entry Co-authored-by: Greg Ziółkowski --- packages/scripts/CHANGELOG.md | 4 ++++ packages/scripts/config/webpack.config.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index cfea089ad09b3..b58849d3d6ee9 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -6,6 +6,10 @@ - The bundled `@svgr/webpack` dependency has been updated from requiring `^5.5.0` to requiring `^6.2.1` ([#38866](https://github.com/WordPress/gutenberg/pull/38866)). See [official migration guide to v6](https://react-svgr.com/docs/migrate/) for details. +### New Feature + +- Automatically copy PHP files located in the `src` folder and its subfolders to the output directory (`build` by default) ([#38715](https://github.com/WordPress/gutenberg/pull/38715)). + ## 21.0.2 (2022-02-15) - Entry points are not detected in Windows OS ([#38781](https://github.com/WordPress/gutenberg/pull/38781)). diff --git a/packages/scripts/config/webpack.config.js b/packages/scripts/config/webpack.config.js index d4ca729dca87f..68dd39c810d41 100644 --- a/packages/scripts/config/webpack.config.js +++ b/packages/scripts/config/webpack.config.js @@ -232,6 +232,11 @@ const config = { context: 'src', noErrorOnMissing: true, }, + { + from: '**/**.php', + context: 'src', + noErrorOnMissing: true, + }, ], } ), // The WP_BUNDLE_ANALYZER global variable enables a utility that represents