Skip to content

Commit

Permalink
Interactivity API: Include preact/debug when SCRIPT_DEBUG is enab…
Browse files Browse the repository at this point in the history
…led (WordPress#60514)

* Create `debug` bundle

* Enqueue debug bundle for 'plugin' development mode

* Include the debug version for plugin and core modes

* Use SCRIPT_DEBUG instead of development mode

Co-authored-by: DAreRodz <[email protected]>
Co-authored-by: sirreal <[email protected]>
Co-authored-by: gziolo <[email protected]>
Co-authored-by: cbravobernal <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
6 people committed Apr 9, 2024
1 parent f6634c4 commit aa3922c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/interactivity-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function gutenberg_reregister_interactivity_script_modules() {

wp_register_script_module(
'@wordpress/interactivity',
gutenberg_url( '/build/interactivity/index.min.js' ),
gutenberg_url( '/build/interactivity/' . ( SCRIPT_DEBUG ? 'debug.min.js' : 'index.min.js' ) ),
array(),
$default_version
);
Expand Down
6 changes: 6 additions & 0 deletions packages/interactivity/src/debug.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* External dependencies
*/
import 'preact/debug';

export * from './index';
1 change: 1 addition & 0 deletions tools/webpack/interactivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
name: 'interactivity',
entry: {
index: './packages/interactivity',
debug: './packages/interactivity/src/debug',
router: './packages/interactivity-router',
navigation: './packages/block-library/src/navigation/view.js',
query: './packages/block-library/src/query/view.js',
Expand Down

0 comments on commit aa3922c

Please sign in to comment.