title: How can we add javascript file to the front-end of typo3 from extensions
body: <p>I just wanna add my javascript file to be added while rendering the all front-end pages not the back-end pages. I have tried :</p>
  
  <pre class="lang-php prettyprint-override"><code>if (TYPO3_MODE=="FE" )   {
     $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class);
     $pageRenderer-&gt;loadRequireJsModule('EXT:eyebase/Resources/Public/JavaScript/testinjectEyebaseJS.js','code');
  }
  </code></pre>
  
  <p>but this code added my js file within the CDATA like:-</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script type="text/javascript"&gt;
  /*&lt;![CDATA[*/
  /*RequireJS-Module-EXT:eyebase/Resources/Public/JavaScript/testinjectEyebaseJS.jse6fb06210fafc02fd7479ddbed2d042cc3a5155e*/
  require(["EXT:eyebase/Resources/Public/JavaScript/testinjectEyebaseJS.js"], code);
  
  /*]]&gt;*/
  &lt;/script&gt;
  </code></pre>
  
  <p>Please guide me how to do this. Thanks in advance.</p>