Skip to content

Commit

Permalink
Storybook: Log warning() when in dev mode (#66568)
Browse files Browse the repository at this point in the history
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent 09def42 commit 355dfd5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External dependencies
*/
const path = require( 'path' );
const DefinePlugin = require( 'webpack' ).DefinePlugin;

/**
* WordPress dependencies
Expand Down Expand Up @@ -107,6 +108,15 @@ module.exports = {
},
],
},
plugins: [
...config.plugins,
new DefinePlugin( {
// Ensures that `@wordpress/warning` can properly detect dev mode.
'globalThis.SCRIPT_DEBUG': JSON.stringify(
process.env.NODE_ENV === 'development'
),
} ),
],
};
},
};

1 comment on commit 355dfd5

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 355dfd5.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11595390210
📝 Reported issues:

Please sign in to comment.