这是indexloc提供的服务,不要输入任何密码
Skip to content

Update node packages and add support for JS modules #450

@parthnvaswani

Description

@parthnvaswani

Summary:

This task involves updating node packages and integrating support for JavaScript modules in the project. This update primarily focuses on enhancing the theme scripts for the Interactivity API and ensuring compatibility with the latest dependencies. Without breaking the existing functionality.

Acceptance Criteria:

  • Update package.json to include the latest dependencies without breaking the existing functionality.
  • Update wp-script dependency to version 27.6.0.
  • Add @wordpress/interactivity as a dependency.
  • Modify scripts to include the --experimental-modules flag.
  • Configure WebpPack to enable experimental module features:
    experiments: {
        outputModule: true,
    },
    output: {
        module: true,
    },
  • Add checks in WebPack configuration to support both module and non-module scripts.
  • Implement proper enqueueing of scripts using wp_enqueue_script_module.
  • Organize the changes within Theme Elementary, placing them in a subfolder named modules in assets/src/js.
  • Add an example script using interactivity API in the modules folder to demonstrate the implementation of JavaScript modules in the project.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions