Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use asset hash for CSS version on custom blocks #67205

Open
andreawetzel opened this issue Nov 21, 2024 · 0 comments
Open

Use asset hash for CSS version on custom blocks #67205

andreawetzel opened this issue Nov 21, 2024 · 0 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.

Comments

@andreawetzel
Copy link

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
Image

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

@andreawetzel andreawetzel added the [Type] Enhancement A suggestion for improvement. label Nov 21, 2024
@gziolo gziolo added the [Feature] Block API API that allows to express the block paradigm. label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants