The wp_enqueue_script function supports two $args for how the script should be enqueued and where:
- $args
- strategy Optional. If provided, may be either 'defer' or 'async'.
- in_footer Optional. Whether to print the script in the footer. Default 'false'.
This would be useful for optimizing code so its non-blocking improving page speed. Right now all scripts come is as blocking.
From what I can tell, this would simply be adding an additional property to the Asset class, adding another parameter to enqueueAsset() and then just passing it as the last arg when actually enqueuing it in ViteCompiler.
The
wp_enqueue_scriptfunction supports two $args for how the script should be enqueued and where:This would be useful for optimizing code so its non-blocking improving page speed. Right now all scripts come is as blocking.
From what I can tell, this would simply be adding an additional property to the Asset class, adding another parameter to enqueueAsset() and then just passing it as the last arg when actually enqueuing it in ViteCompiler.