Skip to content

Commit

Permalink
Add globalThis.SCRIPT_DEBUG replacement to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed May 9, 2024
1 parent f8c3720 commit 75ceb58
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ const scriptConfig = {
plugins: [
new webpack.DefinePlugin( {
// Inject the `SCRIPT_DEBUG` global, used for development features flagging.
SCRIPT_DEBUG: ! isProduction,
'globalThis.SCRIPT_DEBUG': JSON.stringify( ! isProduction ),
SCRIPT_DEBUG: JSON.stringify( ! isProduction ),
} ),

// If we run a modules build, the 2 compilations can "clean" each other's output
Expand Down Expand Up @@ -451,7 +452,8 @@ if ( hasExperimentalModulesFlag ) {
plugins: [
new webpack.DefinePlugin( {
// Inject the `SCRIPT_DEBUG` global, used for development features flagging.
SCRIPT_DEBUG: ! isProduction,
'globalThis.SCRIPT_DEBUG': JSON.stringify( ! isProduction ),
SCRIPT_DEBUG: JSON.stringify( ! isProduction ),
} ),
// The WP_BUNDLE_ANALYZER global variable enables a utility that represents
// bundle content as a convenient interactive zoomable treemap.
Expand Down

0 comments on commit 75ceb58

Please sign in to comment.