0

I'm using default/Magento_Theme/layout/default_head_blocks.xml to add CSS and JS. In developer mode, CSS is being added to static files but JS and files are not.

<?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="js/menu.js"></link>
 <link src="js/iehover-fix.js"></link>
 </head>
</page>
asked Jul 24, 2020 at 9:29

2 Answers 2

0

Try using the script tag and specifying the module:

<script src="Magento_Theme::js/menu.js"/>
<script src="Magento_Theme::js/iehover-fix.js"/>
answered Jul 24, 2020 at 10:48
1
  • I tried this but Magento_Theme:: was not rendering a path Commented Jul 27, 2020 at 7:18
0

My /web folder was not in the correct folder. It should be themename/default/web I had themename/default/Magento_Theme/web

answered Jul 27, 2020 at 7:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.