Build/Test tools: Prevent registering the same private JavaScript API twice.

This sets the IS_WORDPRESS_CORE global variable to true in the webpack build script to enable extra safeguards around private JavaScript APIs.

Props costdev, hellofromTonya, gziolo, peterwilsoncc.
Fixes #57795.


git-svn-id: https://develop.svn.wordpress.org/trunk@55512 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
zieladam 2023-03-10 12:35:42 +00:00
parent 9ac434799d
commit d125ed019c

View File

@ -152,6 +152,8 @@ module.exports = function( env = { environment: 'production', watch: false, buil
new DefinePlugin( {
// Inject the `IS_GUTENBERG_PLUGIN` global, used for feature flagging.
'process.env.IS_GUTENBERG_PLUGIN': false,
// Inject the `IS_WORDPRESS_CORE` global, used for feature flagging.
'process.env.IS_WORDPRESS_CORE': true,
'process.env.FORCE_REDUCED_MOTION': JSON.stringify(
process.env.FORCE_REDUCED_MOTION
),