Skip to content

Adding additional JavaScript static files #40

Closed Answered by nickjj
SHxKM asked this question in Q&A
Discussion options

You must be logged in to vote

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:

import * as hyperscript from 'hyperscript.org';
hyperscript.browserInit();

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.

Replies: 7 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nickjj
Comment options

Answer selected by SHxKM
Comment options

You must be logged in to vote
1 reply
@nickjj
Comment options

Comment options

You must be logged in to vote
1 reply
@nickjj
Comment options

Comment options

You must be logged in to vote
1 reply
@nickjj
Comment options

Comment options

You must be logged in to vote
1 reply
@nickjj
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants