-
So right now adding additional <script src="{% static 'js/hyperscript.min.js' %}" type="application/javascript"></script> I made sure to include |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 5 replies
-
Curiously, at least when running locally this (omitting the <script src="{% static 'hyperscript.min.js' %}" type="application/javascript"></script>
<script src="{% static 'htmx.min.js' %}" type="application/javascript"></script> |
Beta Was this translation helpful? Give feedback.
-
Based on the paths of the files you've supplied so far like htmx, you don't need to add 3rd party dependencies manually. You can leave the esbuild config alone and add those dependencies to the |
Beta Was this translation helpful? Give feedback.
-
Oh that's nice. Unfortunately it doesn't seem to work. Still getting those 404s locally when referencing those paths:
One direction is after modifying |
Beta Was this translation helpful? Give feedback.
-
Maybe because I didn't run
|
Beta Was this translation helpful? Give feedback.
-
@nickjj What you're saying is that I don't need to reference in my These two libraries work "directly" on the html file, so I'm not sure what you mean by:
I'm not referencing them in any JS files, my layman's way is to include the CDN reference/put in static, and just do: <div hx-get="foo"></div>
OK just read your udated answer:
Those two libs are actually actively maintained. So what you're saying is that I have to declare a new JS file, import those libraries from there, and include that JS file in |
Beta Was this translation helpful? Give feedback.
-
Thank you so much @nickjj! Adding this to
Yes, I'm using |
Beta Was this translation helpful? Give feedback.
-
@nickjj searched this repo and links on your website but couldn’t find anything, anywhere I can buy you a coffee? |
Beta Was this translation helpful? Give feedback.
You wouldn't reference them in script tags after NPM installing them. You can import them as a dependency into whatever JS file(s) need to use it.
For example, after NPM installing it:
Most libraries have instructions in their readme file in how to use it when using any bundling tool such as esbuild or webpack. It usually comes down to importing the library. The libs you used as an example don't because they are 7+ years old but I found that snippet here when Googling bigskysoftware/_hyperscript#162 (comment), if that doesn't work you can try the method above it.