What is the proper way to add a js tag attribute in Magento 2?

This is needed for example for Cloudflare Rocket loader to ignore a certain script.

<script data-cfasync="true" type="text/javascript" src="~~">
<script data-cfasync="false" src="/javascript.js"></script> 

Try this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.