Skip to content

Build: Update tools to recognize module dependencies of scripts #75196

@sirreal

Description

@sirreal

What problem does this address?

Changeset 61587 has landed in WordPress and will allow Classic Scripts to depend on Script Modules.

Build tooling should be updated accordingly to detect module dependencies from scripts and include them in the asset file.

This will need to be coordinated with changes when reading the asset files on script registration, for example register_block_type_from_metadata().

What is your proposed solution?

Update relevant build tooling to detect WordPress-provided modules. These modules will only appear in scripts as dynamic import( moduleId ). The modules should be added to the asset files under another key: 'module_dependencies' => array( … ).

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions