0

I have added a custom js file in my child theme and added the link in the default_head_blocks.xml. I am getting errors.

<link src="js/custom.js"/>

<!-- Add external resources -->
<link rel="stylesheet" type="text/css" src="http://fonts.googleapis.com/css?family=Montserrat" src_type="url" />

Is it necessary to specify the custom js in requirejs-config.js ?

1
  • try this code <script src="js/custom.js" /> after clear cache and run php bin/magento setup:static-content:deploy -f Commented Jun 24, 2020 at 5:15

1 Answer 1

0

RequireJS is a JavaScript file and module loader. It improves perceived page load times because it allows JavaScript to load in the background. In particular, it enables asynchronous JavaScript loading

Your Answer

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.