WordPress Tutorials
Adding defer, async and type=module with script_loader_tag
Deferring a script with this filter detaches it from the dependency order WordPress maintains, and any inline script attached to it runs before it loads. Core has had a strategy argument since 6.3 that handles both; the filter remains for what the argument cannot express.