I'm trying to add TomSelect : https://tom-select.js.org/ to a new Laravel project using Vite package manager.
So in app.js I have:
import TomSelect from 'tom-select';
window.TomSelect = TomSelect;
but when I try to initialize the plugin in my blade:
<script>
new TomSelect('#authors');
</script>
i get error: "Uncaught ReferenceError: TomSelect is not defined"
Has anyone managed to add it and tell me what I'm doing wrong?
Tom Select is a dynamic, framework agnostic, and lightweight (~16kb gzipped) <select> UI control. With autocomplete and native-feeling keyboard navigation, it's useful for tagging, contact lists, country selectors, and so on.