Make WordPress Core

Opened 4 months ago

#60163 new enhancement

Block editor admin assets should use asset file version when in debug/local mode

Reported by: helgatheviking's profile helgatheviking Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Script Loader Keywords:
Focuses: Cc:


Admin assets defined in block.json are enqueued in the editor with the version property from block.json of if not defined, the version of WordPress. [source](

That's fine for plugin release, but for development it means you can build a block using the [create block script](, run npm run start and the editor style assets get compiled correctly as you work but the browser keeps showing the cached version stylesheet. Editor scripts however, [pull a version from the index.asset.php]( so it's always refreshed on page reload.

I'd love to see the order go something like:

If dev mode (either WP_DEVELOPMENT_MODE or WP_ENVIRONMENT_TYPE constants then use the version of index.asset.php.

If not dev mode, use the version from the block.json file.

Finally, default to the version of WordPress.

Change History (0)

Note: See TracTickets for help on using tickets.