Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

built and minified js bundle of the contacts module #100

Open
michielbdejong opened this issue Mar 24, 2024 · 3 comments
Open

built and minified js bundle of the contacts module #100

michielbdejong opened this issue Mar 24, 2024 · 3 comments

Comments

@michielbdejong
Copy link
Collaborator

Hi @angelo-v,

Modern javascript practices notwithstanding ;) I would like to include your data module as a bundled and minified .js file that I can directly put into a <script src=""> tag in my html. I tried using a <script module src=""> tag but didn't get that working.

@michielbdejong
Copy link
Collaborator Author

Using webpack probably?

@michielbdejong
Copy link
Collaborator Author

This is also what rdflib uses

@angelo-v
Copy link
Collaborator

Here is a working example of how you can use the module with Plain HTML and ESM import, without a build step.

The key is to generate an import map, which you can do e.g. via https://generator.jspm.io

An application that wants to use this module either has to create a bundle itself, or use importmaps. I do not think it is recommended to do the bundling in the library itself. Otherwise we need to include rdflib and all its dependencies as well. Usually a client app needs more than only this module as a dependency. If everything is bundled already there will be a lot of code duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants