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
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