Earthstar suggests importing the browser bundle from a CDN.
<script type="module">
import * as Earthstar from "https://cdn.earthstar-project.org/js/earthstar.bundle.v8.2.4.js";
</script>
However, I would like to install the bundle locally, so my build environment (Snowpack) can include it and my PWA library (Workbox) can cache it. Since Earthstar does not include their browser bundle in the npm packages, this repo serves to provide an alternative option.
Include this repo as a npm dependency in package.json
. Tagged versions of this repo will correspond with Earthstar versions.
{
"dependencies": {
"earthstar-bundle": "basham/earthstar-bundle#v8.2.4"
}
}
Then import the bundle from the node_modules
folder, like normal.
import * as Earthstar from 'earthstar'
- Update the Earthstar version in
Makefile
andpackage.json
. - Make the bundle (
make bundle
). - Commit.
- Tag the commit (
git tag v#.#.#
). - Push to GitHub (
git push --tags
).