You can export function from component in the script context="module".
context="module"
<script context="module"> export function test(){ return "test"; } </script>