I want to import js file in some antlers template and use in it function from js file Example:
<div id="logout" class="logout hidden" onclick="logout()">
<i class="material-icons">logout</i>
</div>
{{ vite src="resources/js/header.js" }}
Header.js:
function logout(){
return apiService.get('/logout')
}
But in console I have error that
"TypeError: logout is not a function at HTMLDivElement.onclick"
How to use JS in Statamic CMS template???