Releases: esm-dev/esm.sh
v115
in v115, we added ?module
query to allow you import .wasm
as a WebAssembly.Module
Object:
import wasm from "https://esm.sh/@dqbd/[email protected]/tiktoken_bg.wasm?module"
const { exports } = WebAssembly.instantiate(wasm, imports)
Changelog:
v114
In v114, we switched to pnpm instead of yarn which can save the server disk space and improve the build performance significantly, and now the server can handle package files of private registry (thanks @Justinidlerz for contributing to this).
We upgraded esbuild to 0.17.14, and a new query ?conditions
added as conditions option of esbuild:
import foo from "https://esm.sh/foo?conditions=custom1,custom2"
For Deno users, we fixed some incorrect/missed types. Thanks for @marvinhagemeister making him first great PR to this project.
Changelog:
- Add
?conditions
query as esbuild option - Use pnpm to install packages instead of yarn (save the server disk space & improve the build performance)
- Serve static files on local (#564 @Justinidlerz)
- Support
.d.mts
extension (close #580) - Fix CJS transpiling (close #577)
- Fix types building (close #572, #576)
- Fix invalid type URL if submodule is main entry (#579 @marvinhagemeister)
- Upgrade esbuild to 0.17.14
v113
v112
The CDN serves over 5M requests each day currently, which is powered by Cloudflare's edge worker, it's globally fast! (you can check the benchmark by @azu: https://github.com/azu/npmcdn-upptime).
Changes:
- Use
.mjs
extension for the package main module to resolve sub-path conflicts - Ignore
?exports
query when importing stable modules - Fix npm naming regexp (close #541)
- Fix tree shaking (close #521)
- Fix package nested conditions export (#546 by @Justinidlerz)
- Fix esm imports in cjs (close #557)
- Improve server performance (#543 by @Justinidlerz)
- Update the
requireModeAllowList
(close #540, #548)
For Deno:
- Inject
XHR
polyfill foraxios
,cross-fetch
,whatwg-fetch
automatically - Fix
node:buffer
import fordenonext
target (closed #556) - CLI: Use user-specified indent size (#551 by @npg418)
Credits
Huge thanks to @Justinidlerz @npg418
v111
- Print package
deprecated
message
- Remove source map URL of worker
- Fix package CSS redirects with
target
option - Fix build dead-loop for some edge cases
- Fix CLI
update
command (close #536)
CDN Update
Before when you import a module without specifying the package version like "https://esm.sh/react", it will redirect to latest version like "https://esm.sh/[email protected]", that means it needs to ask the NPM registry what the latest version of the package every time, in v111 we added a cache layer for the NPM registry to improve the redirect response time. Since we set the cache TTL to 10 minutes, so you may get the delay of the package latest update, but for a CDN the response time is the most important care-thing, the best practice is always point out the full version of packages like "https://esm.sh/[email protected]".
v110
v109
v108
- Add
denonext
target to use deno 1.31 node compatibility layer, we will switch to thedenonext
target as default for deno once deno deploy supportsnode:
specifier.import "https://esm.sh/your-package?target=denonext"
- Redirect to CSS file for CSS packages
https://esm.sh/normalize.css -> https://esm.sh/normalize.css/normalize.css
- Fix wasm packages can't resolve the default wasm file.
import init, { transform } from "https://esm.sh/lightningcss-wasm"; // v107: you need to specify the wasm URL await init("https://esm.sh/lightningcss-wasm/lightningcss_node.wasm") // v108: you don't need to specify it await init()
- Disable
bundle
mode for stable builds - Fix alias export (close #527)
- Update references to reqOrigin to use cdnOrigin (#529 by @jaredcwhite)
Credits
Huge thanks to @jaredcwhite
v107
- Add
?cjs-export
query (close #512)
If you get an error like...not provide an export named...
, that means esm.sh can not resolve CJS exports of the module correctly. You can add?cjs-exports=foo,bar
query to specify the export names:import { NinetyRing, NinetyRingWithBg } from "https://esm.sh/[email protected]?cjs-exports=NinetyRing,NinetyRingWithBg"
- Update
requireModeAllowList
(close #520) - Remove
?sourcemap
query, always generate source map as inline url. - Default export all members from original module to prevent missing named exports members (#522)
- Only apply patch if types are missing in preact (#523)
- Upgrade
esbuild
to 0.17.10. - Upgrade
deno/std
to 0.177.0
Credits
Huge thanks to @Justinidlerz @zookatron