...
Create a template file hawksearchjs.phtml
, having specified the following:. Specify full or minified version of hawksearch.js file in $jsPath
variable
Code Block | ||
---|---|---|
| ||
<?php use Magento\Framework\View\Element\Template; use HawkSearch\Proxy\ViewModel\Config as ConfigViewModel; /** @var Template $block */ /** @var ConfigViewModel $configViewModel */ $configViewModel = $block->getData('configViewModel'); if (!$configViewModel) { return; } $jsPath = 'includes/hawksearch';//Use value 'includes/hawksearch.min' for minified file version ?> <script type="text/javascript"> (function() { var config = { paths: { "HawkSearch_Proxy/js/hawksearch": "<?= /* @noEscape */ $configViewModel->getHawkUrl('includes/hawksearch'$jsPath) ?>" } }; require.config(config); })(); </script> |
...