wp_enqueue_script_module( string $id, string $src = '', array $deps = array(), string|false|null $version = false )

Marks the script module to be enqueued in the page.

Description

If a src is provided and the script module has not been registered yet, it will be registered.

Parameters

$idstringrequired
The identifier of the script module. Should be unique. It will be used in the final import map.
$srcstringoptional
Full URL of the script module, or path of the script module relative to the WordPress root directory. If it is provided and the script module has not been registered yet, it will be registered.

Default:''

$depsarrayoptional
List of dependencies.

You must log in before being able to contribute a note or feedback.