wordpress-develop/tools
Greg Ziółkowski a3c6b4c634 Build: Introduce SCRIPT_DEBUG global in webpack processing
Backports the same changes to the webpack config in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/50122.

The `warning` function from `@wordpress/warning` no longer worked correctly with webpack 5. In practice, it no longer called `console.warn`. To fix it, the usage of `process.env.NODE_ENV` check got replaced with another optional global: `SCRIPT_DEBUG`. All the tools used in the Gutenberg, get updated to work with this new constant, including `@wordpress/scripts`. This way, developers are able to guard code that should be run only in development mode. In WordPress core, the same constant needs to be added mostly to ensure that the code behind the check gets completely removed in production mode.

Fixes #59407.



git-svn-id: https://develop.svn.wordpress.org/trunk@56699 602fd350-edb4-49c9-b593-d223f7449a82
2023-09-26 06:49:55 +00:00
..
local-env General: Introduce WP_DEVELOPMENT_MODE constant to signify context-specific development mode. 2023-06-26 19:55:28 +00:00
release Tools: Fix unresolvable conflicts computation in package sync script. 2023-06-26 15:41:25 +00:00
webpack Build: Introduce SCRIPT_DEBUG global in webpack processing 2023-09-26 06:49:55 +00:00