Add a JavaScript module

This information applies to:

On-Prem
Adobe Commerce Cloud
Adobe Commerce as a Cloud Service
Aobe Commerce Optimizer
Yes
Yes
No
No

Learn how to develop a simple JavaScript module that shows the greeting “Hello World” on the storefront.

Who is this video for?

  • Developers

Steps

  1. Create a module.
  2. Add requirejs-config.js and a JavaScript module file.
  3. Create a layout update that loads a template for the module.
  4. Create the template file.
  5. Register the module and test it on the storefront.

Video content

  • Set up the module and RequireJS configuration.
  • Wire the script through a layout update and template.
  • Verify the greeting on the page.

Useful resources

recommendation-more-help
commerce-learn-help-home