Skip to content

Commit

Permalink
Better replacement
Browse files Browse the repository at this point in the history
Webpack replacements are source string replacements
  • Loading branch information
sirreal committed May 9, 2024
1 parent 75ceb58 commit fc21aa3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools/webpack/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ const plugins = [
process.env.WP_BUNDLE_ANALYZER && new BundleAnalyzerPlugin(),
new DefinePlugin( {
// Inject the `IS_GUTENBERG_PLUGIN` global, used for feature flagging.
'globalThis.IS_GUTENBERG_PLUGIN':
process.env.npm_package_config_IS_GUTENBERG_PLUGIN,
'globalThis.IS_GUTENBERG_PLUGIN': JSON.stringify(
Boolean( process.env.npm_package_config_IS_GUTENBERG_PLUGIN )
),
// Inject the `IS_WORDPRESS_CORE` global, used for feature flagging.
'globalThis.IS_WORDPRESS_CORE':
process.env.npm_package_config_IS_WORDPRESS_CORE,
'globalThis.IS_WORDPRESS_CORE': JSON.stringify(
Boolean( process.env.npm_package_config_IS_WORDPRESS_CORE )
),
// Inject the `SCRIPT_DEBUG` global, used for dev versions of JavaScript.
'globalThis.SCRIPT_DEBUG': mode === 'development',
'globalThis.SCRIPT_DEBUG': JSON.stringify( mode === 'development' ),
} ),
mode === 'production' && new ReadableJsAssetsWebpackPlugin(),
];
Expand Down

0 comments on commit fc21aa3

Please sign in to comment.