Hi,
I would like to use a variable set with twig but into a javascript file.
for now this is how I do it :
<script>
var baseUrl = "{{ url('theme://') }}";
var homeUrl = "{{ home_url }}";
</script>
<script src="{{ url('theme://js/main.js') }}" ></script>
But I'm pretty sure, there's a better / safer / cleaner way to do it. On wordpress, I was able to put my var directly in my javascript file with the function.php file. Is there something like this around here ?
Thank you very much