Magento 2 template with require js declaration using X-MAGENTO-INIT. You can define require js with the Magento PHTML template file. Benefit: Declare JS using text/x-magento-init will be loaded after the page DOM is loaded completelyContinue reading "How to load JAVASCRIPT In a PHTML template with requirejs VIA X-MAGENTO-INIT?"

Read more of this post