Skip to content

jg-wright/esm.dev

Repository files navigation

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

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 up

Once 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 'package-1'
  import React from 'react
  // ...
</script>

About

ESM.sh dev enrionment

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors