F
Filament14mo ago
jals65

Loading a npm package

I have installed a package trow npm: npm install easymde How can I use this package in a livewire component template like this? easyMDE = new EasyMDE({element: document.getElementById('{{$this->getName()}}')});
6 Replies
cheesegrits
cheesegrits14mo ago
A good starting point is to read the Asset docs, and specifically the various ways of packaging / including JS assets. Then give us a little more detail on exactly what you are trying to do, and how it relates to Filament. https://filamentphp.com/docs/3.x/support/assets#registering-javascript-files
jals65
jals65OP14mo ago
Yes, I read that, but in that documentation is linking a js that is in de resource path. In my case is a npm package that i install in node-modules
Dennis Koch
Dennis Koch14mo ago
Usually you would import that and bundle it up
cheesegrits
cheesegrits14mo ago
OK, so as I said, now explain in more detail exactly what you are trying to do. Like, where do you need this Javascript, what do you need to do with it.
Saade
Saade14mo ago
Laracasts
Build Advanced Components for Filament
Once you're confidently building interfaces with all the components that are included with Filament, you'll likely want to begin building your own custom ones. Hi, I'm Dan: the co-founder of Filament. This series will teach you how to build components, like custom form fields and table columns, and how to distribute them in a plugin package. Me...
jals65
jals65OP14mo ago
Finaly I download the js and the css of the library and i include it in my files.
Want results from more Discord servers?
Add your server