O'Reilly logo

Magento 2 Theme Design - Second Edition by Richard Carter, Fernando J Miguel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing and locating JavaScript component

With the portability provided by RequireJS, you can specify JavaScript resources used in your modules and themes. The scope of action, as well as the basic structure of directories can be defined in:

  • Library: JavaScript libraries used for application of libraries and archives in several modules and themes, aiming at the reuse in themes projects. Addresses the use in the lib/web directory.
  • Module: Application of libraries and files with the reduced scope, acting only in the module. Addresses its use in the <module_dir>/view/<areaname>/web.
  • Theme: Application of libraries and archives with reduced scope, acting only in the theme. Addresses its use in the directory <theme_dir>/<VendorName>_<ModuleName>/web ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required