Documentation missing: Using @wordpress/scripts 28.x with WordPress <6.5 #64423
threadi
started this conversation in
Developer Experience
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently looking for a way to use the current @wordpress/scripts 28.x in a plugin with WordPress 6.5 or older. According to the tip here, you should deliver the jsx-runtime via webpack, but create it separately so that it is not included in the assets.
This script for me means that only the react-jsx-runtime.js is generated and no JS and style files:
I then extended the script so that the missing files are also generated via a 2nd module in webpack, and the react-jsx-runtime.js is also generated:
Problem here: the JS files still contain the JSX runtime and therefore cannot be used with WordPress < 6.5. The runtime is still in the assets file. I can easily remove it from there:
But how can I remove the JSX Runtime from the generated JavaScripts? These only have the following imports:
Beta Was this translation helpful? Give feedback.
All reactions