Download the PHP package yireo/magento2-hyva-theme-auto-registration without Composer
On this page you can find all versions of the php package yireo/magento2-hyva-theme-auto-registration. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yireo/magento2-hyva-theme-auto-registration
More information about yireo/magento2-hyva-theme-auto-registration
Files in yireo/magento2-hyva-theme-auto-registration
Package magento2-hyva-theme-auto-registration
Short Description Automatically include modules in the Hyvä Theme registration
License OSL-3.0
Informations about the package magento2-hyva-theme-auto-registration
Yireo HyvaThemeAutoRegistration
Magento 2 module to make it easier to register a custom tailwind.config.js
file of your own module in the global Hyvä Themes Tailwind configuration
Background
Hyvä Themes offers a Magento 2 CLI command hyva:config:generate
to allow building a file app/etc/hyva-themes.json
that again is used in modern-day Tailwind configuration of Hyvä-based themes. However, to extend this, one must add a custom observer to the module, which leads to a lot of code duplication across your modules. This module aims to simplify this. It offers an observer following the official Hyvä documentation.
However, this observer automatically registers any module that has a prefix Yireo_
or YireoTraining_
(it works for me). And it allows for extending things with a DI plugin.
Usage
Add this module as a dependency to your composer.json
file and etc/module.xml
file.
Next, add the following DI configuration to your module its etc/di.xml
file (assuming here that Foo_Bar
is the name of your own module):
Alternatively, you can include all your modules by configuring a module prefix: