How can we add javascript file to the front-end of typo3 from extensions

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 : if (TYPO3_MODE==”FE” ) { $pageRenderer = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Page\PageRenderer::class); $pageRenderer->loadRequireJsModule(‘EXT:eyebase/Resources/Public/JavaScript/testinjectEyebaseJS.js’,’code’); } but this code added my js file within the CDATA like:- <script type=”text/javascript”> /*<![CDATA[*/ /*RequireJS-Module-EXT:eyebase/Resources/Public/JavaScript/testinjectEyebaseJS.jse6fb06210fafc02fd7479ddbed2d042cc3a5155e*/ require([“EXT:eyebase/Resources/Public/JavaScript/testinjectEyebaseJS.js”], code); /*]]>*/ </script> Please guide me…

Discover more