I need to add custom validation rule to postcode field in my checkout page. Therefore I need to extend Magento_Ui/js/lib/validation/rules.js
file.
How can I achieve it in custom module (not theme)?
magento2
I need to add custom validation rule to postcode field in my checkout page. Therefore I need to extend Magento_Ui/js/lib/validation/rules.js
file.
How can I achieve it in custom module (not theme)?
Best Answer
You can override inside your module using below way, app/code/Krish/Checkout/view/frontend/requirejs-config.js
Create js file at app/code/Krish/Checkout/view/frontend/web/js/lib/validation/rules.js
Run php bin/magento setup:static-content:deploy command.