esm.dev
v2.0.7
Published
TypeScript library template
Readme
esm.dev
A set of utils when working with local NPM packages and esm.sh.
It expects you to have a local version of ESM.sh and verdaccio running. It will monitor changes in a configurable set of directories. When it sees any changes, it will unpublish from verdaccio, remove builds & cache from ESM.sh and then re-publish the package.
Usage
Prerequisites
- You have docker installed
- You have docker compose installed
- You have a JavaScript runtime installed, EG: Node.js
Installation
# Node.js
npx esm.dev init ./packages/my-local-package-1 ./packages/my-local-package-2 ...This will create a docker-compose file in your cwd. Now run it:
docker compose upOnce the above is running point your ESM modules to localhost:3000:
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react",
"package-1": "http://localhost:3000/package-1"
}
}
</script>
<script type="module">
import Package1 from 'package1'
// ...
</script>