Skip to content

Instantly share code, notes, and snippets.

@markshust
Created June 17, 2022 12:20
Show Gist options
  • Select an option

  • Save markshust/b02a337d9237458cf53469a941fd0b24 to your computer and use it in GitHub Desktop.

Select an option

Save markshust/b02a337d9237458cf53469a941fd0b24 to your computer and use it in GitHub Desktop.
Add a JavaScript file to all pages of Magento with head.link node
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<link src="Foo_Bar::js/my-js-file.js"/>
</head>
</page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment