I'm using https://github.com/szimek/signature_pad. And I want to use local JS instead of the CDN one. So, I installed with npm like it says in the docs.
I'm using Laravel with Vite. And, one the page where I need the signature, I put a
@pushonce('scripts')
<script src="https://cdn.jsdelivr.net/npm/signature_pad@4.0.0/dist/signature_pad.umd.min.js"></script>
@endpushonce
Just by removing that cdn script and installing via npm, SignaturePad is not defined
.
So what do I need to put where, in order to use the .js
from node_modules
? Preferably just on the page where I need it. Otherwise, included in the Vite build.