staticbackendhq / core

Backend server API handling user mgmt, database, storage and real-time component
https://staticbackend.com
MIT License
700 stars 66 forks source link

[backend-js] Build an additional bundle importable via <script> tag #81

Closed dstpierre closed 1 year ago

dstpierre commented 1 year ago

The JavaScript client library currently only build a bundle that can be imported, for instance in a React application via:

import { Backend } from "@staticbackend/js";

It could be nice to have an option to directly use the library via a <script> tag in vanilla JavaScript, a bit like Alpine.js or htmx:

<script src="/some/path/backend.js"></script>

I'm not certain if it's possible, I think it's what is called a IIFE. Do we need to update the build system.

In short, I could use the help of a more experienced front-end developer with everything bundling related.

dstpierre commented 1 year ago

I've added the iife output for the v1.5.0-alpha.0