TransWikia.com

Static CSS files being generated by JS isn't

Magento Asked on December 26, 2021

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>

2 Answers

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

Answered by Sam on December 26, 2021

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 by Ben Crook on December 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP