Override Magento UI js file
-
05-02-2021 - |
Frage
How can I override this file on my theme?
/vendor/magento/module-ui/view/frontend/web/js/view/messages.js
I'm a newbie to M2
Lösung
In your custom module [Namespace]/[Module]/view/frontend/requirejs-config.js
add this
var config = {
map: {
'*': {
'Magento_Ui/Magento_Ui/js/view/messages.js':'[Namespace]_[Module]/js/view/messages.js'
}
}
};
your overridden js file should be here [Namespace]_[Module]/view/frontend/web/js/view/messages.js
run below command:
php bin/magento setup:upgrade && php bin/magento setup:static-content:deploy -f
read more here: Extending / Overriding JS in Magento 2
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange