Use asset hash for CSS version on custom blocks #67205
Labels
[Feature] Block API
API that allows to express the block paradigm.
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
I have a custom block that was started with create-block. Both the editorScript and style paths are set in block.json. When I inspect the block in the editor, I see that the JavaScript file has the asset hash set as the ver number, but the CSS file is set to the version number set in block.json. The block CSS gets cached by the browser unless we increment the block version which is cumbersome during testing.
Screenshot from local testing that shows the version hash used for JS, block version number used for CSS
What is your proposed solution?
Use the hash as the CSS Version number in wp-scripts by default, or create an option to build the files this way
The text was updated successfully, but these errors were encountered: