🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

118 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

esimport: Blazing fast ESM compiler and importmap generator

Baseline: Newly available

Sponsors

Sponsors

Why

ESM is the future. No bundling, no bullsh*t.

esimport is fast πŸ”₯, simpel πŸ§ƒ, secure πŸ΄β€β˜ οΈ, and backwards compatible ☎️.

Comparison esimport vs esh.sh vs jsDelivr
esimport esm.sh jsDelivr
private package support βœ… ❌ ❌
offline development βœ… ⚠️ ❌
dependabot support βœ… ❌ ❌
integrity support βœ… ❌ ❌
supply chain attacks protection βœ… ❌ ❌
highly efficient client caching βœ… βœ… βœ…

Usage

# esimport <package-root> <output-dir> [--watch,--serve,--path-prefix,--verbose,--help]
npx esimport . ./public/static/  --serve

That's it!

Output

Let's assume we have a project with Lit and a custom component defined via imports. After running esimport we have the following output:

# the folder containing browser ready ESM files
$ tree -d out
out
β”œβ”€β”€ src
└── node_modules
    β”œβ”€β”€ lit
    β”‚Β Β  β”œβ”€β”€ decorators
    β”‚Β Β  └── directives
# a fully resolved importmap with sha256, sha384, and sha512 hashes
$ jq '.' out/importmap.json
{
  "imports": {
    "#js/components/myWidget": "src/js/components/myWidget-KWLRK5KY.js",
    "lit": "node_modules/lit/index-W3JFEEGS.js",
    "lit/async-directive.js": "node_modules/lit/async-directive-C4RAQ6VS.js",
    "lit/decorators.js": "node_modules/lit/decorators-RLPUYE5L.js",
    // …
  },
  "integrity": {
    "src/js/components/myWidget-KWLRK5KY.js": "sha256-… sha384-… sha512-…",
    "node_modules/lit/index-W3JFEEGS.js": "sha256-… sha384-… sha512-…",
    "node_modules/lit/async-directive-C4RAQ6VS.js": "sha256-… sha384-… sha512-…",
    "node_modules/lit/decorators-RLPUYE5L.js": "sha256-… sha384-… sha512-…",
    // …
  }
}

About

Blazing fast ESM compiler and importmap generator

Topics

Resources

Code of conduct

Security policy

Stars

5 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages