deno.land / x / esm@v135_2 / CHANGELOG.md
raw.esm.sh
hostname for ?raw option?no-bundle
optionesm.sh
field in package.jsontransformOnly
option for build apiallowList
in config (#745 by @olekenneth).npmrc
file if NpmRegistry
is set (close #737) (#751 by @edeustace)?raw
to support requests for raw package source files (#731 by @johnyanarella)setMaxListeners
to node:events
polyfill (#719)cwd
method of node:process
polyfill (close #718)applyConditions
function use node
condition for browser (close #732)*.css.js
path (close #728)browser
in package.json?external=*
set (close #714)bigint
and top-level-await
for all targets (close #711)node:process
ployfill module mssing the hrtime
methodgit
commandvaryUA
option for polyfill modules/build
API*.mjs
url?external
option ignoring sub-modulesexports
in package.json (close #705).js
) to new build path (.mjs
) (close #703).mjs
module (close #691)?bundle
mode ignores node_process.js
(close #694)@types/react@18
to 18.2.15x-esm-deps
header (close #683)exports
of package.json when looping (close #683)typeof window
for deno target (close #681)?target=node
"
x-real-origin
header?external
of depsAccess-Control-Expose-Headers
headerspreload
importsmodern-normalize
to the cssPackages
?alias
(close #671)esm
tag function of build API now imorts moduleimport { esm } from "https://esm.sh/build";
const mod = await esm`
export const foo:string = "bar"
`;
console.log(mod.foo); // "bar"
node-fetch
import in cjs modules (close #649)node:worker_threads
polyfill(fake) (close #648)denonext
target for Deno >= 1.33.2 (close #646).json.js
path (close #645)deno/std
to 0.177.1/server
endpoint for Deno to serve esm.sh locally.d.ts
walker (close #640)v
prefix in version
(close #639)findFiles
function (close #638)X-Real-Origin
and X-Esm-Worker-Version
headersCORS
issue (close #631)browser
field for package main if possible{
"name": "pkg",
"version": "1.0.0",
"main": "./index.js",
"browser": {
"./index.js": "./browser.js"
}
}
?css
and GET /build
*.js.js
module path (close #627)pako
to the requireModeAllowList
HEAD
methodX-Typescript-Types
headerexports
reslovingnull
for browser exclude (close #613)zlib-sync
to nativeNodePackages (close #621)*.json
urlSTABKE_VERSION
for dts build of stableBuild
__export(require("..."))
pattern (close #611)Auth
middlewarestableBuild
to v118stableBuild
.json
as a module (close #601).wasm
module importing (close #602)/v100/PKG/TARGET/index.js
nativeNodePackages
(close #591)typesVersions
(close #593)exports
glob condition resloving (close #594)?module
query with wasm
files@types/node
to 18?conditions
query as esbuild option.d.mts
extension (close #580)express
is working in Denonetmask
and xml2js
(#561 @jcc10)default
import of deps for cjs (close #565, #566).mjs
extension for the package main module to resolve subpath conflicts?exports
query when importing stable modulesFor Deno:
XHR
polyfill for axios
, cross-fetch
, whatwg-fetch
automaticallydeprecated
messagetarget
optionupdate
command (close #536)Content-Type
header for dts files?external
option for stable buildsreact/jsx-runtime
bundles react
moduledenonext
target to use deno 1.31 node compatibility layerhttps://esm.sh/normalize.css -> https://esm.sh/normalize.css/normalize.css
import init, { transform } from "https://esm.sh/lightningcss-wasm";
// before: you need to specify the wasm file path
await init("https://esm.sh/lightningcss-wasm/lightningcss_node.wasm")
// after: you don't need to specify it
await init()
bundle
mode for stable builds?cjs-export
query (close #512)...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/react-svg-spinners@0.3.1?cjs-exports=NinetyRing,NinetyRingWithBg"
requireModeAllowList
(close #520)?sourcemap
query, always generate source map as inline url.esbuild
to 0.17.10.deno/std
to 0.177.0package.json
HeadlessChrome/
UA (close #509)deno/std
to 0.175.0FileSystem
interface of the storage.exports
in package.json (close #497)/#/
path (close #502)inject
argument for worker factoryimport workerFactory from "https://esm.sh/xxhash-wasm@1.0.2?worker";
const workerInject = `
self.onmessage = (e) => {
// variable 'E' is the xxhash-wasm module default export
E().then(hasher => {
self.postMessage(hasher.h64ToString(e.data));
})
}
`;
const worker = workerFactory(workerInject);
worker.onmessage = (e) => {
console.log(e.data); // 502b0c5fc4a5704c
};
worker.postMessage("Hello");
?external
arg in bundle mode (close #498)require()
syntax support for dts transformerbasePath
doesn't take effect on redirects (close #481)X-TypeScript-Types
header not pined for stable buildsesbuild
to 0.16.17deno/std
to 0.173.0browser
field of package.json to improve compatibility with npm packages in browser. For example, the webtorrent
package will use memory-chunk-store
instead of fs-chunk-store
and exclude built-in modules like fs
, net
, os
and so on.{
"name": "webtorrent",
"description": "Streaming torrent client",
"version": "1.9.6",
"browser": {
"./lib/server.js": false,
"./lib/conn-pool.js": false,
"./lib/utp.js": false,
"bittorrent-dht/client": false,
"fs": false,
"fs-chunk-store": "memory-chunk-store",
"load-ip-set": false,
"net": false,
"os": false,
"ut_pex": false
},
}
?bundle
mode with illegal paths (close #476).?worker
mode doesn't support CORS.browser
field when it's an es6 module (close #381).Access-Control-Allow-Origin
header (close #453).esbuild
to 0.16.10.deno/std
to 0.170.0..d.ts
, .wasm
and other static files.?deps
purge (close #420)?export
query of sub build taskdeno/std
to 0.165.0.import { __await, __rest } from "https://esm.sh/tslib" // 7.3KB
import { __await, __rest } from "https://esm.sh/tslib?exports=__await,__rest" // 489B
node-fetch
polyfill for browsers and denons
process when got "unreachable" error (close #448)exports
resolver (close #422)swc
to latesthttps://esm.sh/build-target
endpoint to return the build target
of current browser/runtime by checking User-Agent
header.--npm-token
option to support private packages (#435).polyfills/node_process
: replace timeout with queueMicrotask
(#444).deno/std
to 0.162.0.fs
ployfill for browsers(add createReadStream
and createWriteStream
methods)web-streams-ponyfill
build (close #417)?deps
and ?alias
resolvingsolid-js/web
build for Denoadd react:preact/compat
pattern for the deno CLIdeno/std
to 0.153.0.@types/react
version (close #331)__esModule
resolving (close #410)postcss-selector-parser
cjs exports (close #411)solid-js/web
of deno
targetdeno/std
to 0.154.0stable
channel for UI libraries like react, to avoid multiple copies of runtime by cachehttps://esm.sh/v92/react@18.2.0/deno/react.js -> https://esm.sh/stable/react@18.2.0/deno/react.js
external all
arg in types builddeno/std
to 0.152.0deno run -A https://esm.sh/v91 init
deno task npm:[add/update/remove]
commands to manage the npm packages in the import maps.deno task npm:add react react-dom # add packages
deno task npm:add react@17 react-dom@17 # add packages with specified version
deno task npm:update react react-dom # upgrade packages
deno task npm:update # update all packages
deno task npm:remove react react-dom # remove packages
imports
of package.json (close #400)npmNaming
range (close #401)import_map.json
file in the working directory:deno install -A -n esm -f https://esm.sh
esm add react react-dom # add packages
esm add react@17 react-dom@17 # add packages with specified version
esm upgrade react react-dom # upgrade packages
esm upgrade # upgrade all packages
esm remove react react-dom # remove packages
Ensure to point the
import_map.json
in yourdeno run
command or thedeno.json
file.
/v89/*some-package@version
external all pattern, do NOT use directly, use the CLI mode instead./@types/
to the .d.ts
file instead of build__exportStar
not used (close #389)resolve
package (close #392)prisma
build?deno-std=$VER
to specify the deno std version for deno node polyfills__esModule
exportexports.development
conditions in package.json
(close #375)solid-js/web?target=deno
strip ssr functions@types/node
types transforming (close #363)?external
doesn't support .dts
files (close #374)keycode
, vscode-oniguruma
& lru_map
(close #362, #369)?external
query, this will give you better user experience when you are using import maps.// import_map.json
{
"imports": {
"preact": "https://esm.sh/preact@10.7.2",
"preact-render-to-string": "https://esm.sh/preact-render-to-string@5.2.0?external=preact",
}
}
?no-dts
(equals to ?no-check
) query?keep-names
query for esbuild (close #345)fixAliasDeps
function that imports multiple React when using ?deps=react@18,react-dom@18
?deps
query(close #338)node-fetch
dep to node-fetch-native
(close #336)--keep-names
option for esbuild by default (close #335)?alias
query?deps
query (close #333)?deps
and ?alias
depth queryesm.sh
instead of cdn.esm.sh
x-typescript-types
headerrenderToReadableStream
export of react/server
in denofetchPackageInfo
dead loop (close #301)deno/std/node
from cdn.deno.land
automaticallyes2022
target?deps
mode?pin
(close #292)?deps
and ?alias
to dependencies (close #235)?worker
by default?no-require
flag, with this option you can ignore the require(...)
call in ESM packages. To support logic like below:// index.mjs
let depMod;
try {
depMod = await import("/path")
} finally {
// `?no-require` will skip next line when resolving
depMod = require("/path")
}
jsx-runtime
with query: https://esm.sh/react?pin=v72/jsx-runtime
-> https://esm.sh/react/jsx-runtime?pin=v72
bare
code when target
and pin
provided to reduce requests// https://esm.sh/react@17.0.2
export * from "https://cdn.esm.sh/v69/react@17.0.2/es2021/react.js";
// https://esm.sh/react@17.0.2?target=es2020&pin=v70
{content just from https://cdn.esm.sh/v69/react@17.0.2/es2021/react.js}
parseCJSModuleExports
function to v68 (close #277, #279)exports
resolving in package.json (close #278, #280)std/node
to 0.130.0before: react-dom@18-rc.2 -> react@18-rc.2-next.xxxx
now: react-dom@18-rc.2 -> react@18-rc.2
react
in react-dom@rc
)bundle
mode (close #271)jsnext:main
in package.json (close #272)cjs-esm-exports
to support UMD
format// exports: ['foo']
const { exports } = parse('index.cjs', `
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.MMDParser = global.MMDParser || {})));
}(this, function (exports) {
exports.foo = "bar";
}))
`);
react/jsx-dev-runtime
and react-refresh
into dev modetypeof window !== undefined
to typeof document !== undefined
for deno
targetobject-assign
with Object.assign
esbuild
to 0.14.25exports
resloving of package.json
(close #179)?path
query to specify the submodule
, this is friendly for import maps with options (close #260)// import-map.json
{
imports: {
"react-dom/": "https://esm.sh/react-dom?target=es2015&path=/"
}
}
// equals to https://esm.sh/react-dom/server?target=es2015
import { renderToString } from "react-dom/server"
deno.land/std/node
polyfill to 0.125.0esbuild
to v0.14.18process
compatibility (close #253)deno.land/std/node
polyfill to 0.122.0deno.land/std/node
polyfill to 0.121.0cjs-esm-exports
to support some edge cases: var foo = exports.foo || (exports.foo = {});
((bar) => { ... })(exports.bar || (exports.bar = {}));
@types
verisoning:marked
-> @types/marked@4.0.1
marked@2
-> @types/marked@2.0.5
marked?dep=@types/marked@4.0.0
-> @types/marked@4.0.0
deno.land/std/node
polyfill to 0.119.0esbuild
to v0.14.8/wp-admin/login.php
?pin
mode when build failed (close #206)?pin
modemarked@4
importcjs-esm-exports
supports tslib __exportStar
(close #197)perf_hooks
polyfill?worker
mode on deno (#198)he
to cjs-esm-exports
require mode allow list (close #200)import editorWorker from '/monaco-editor/esm/vs/editor/editor.worker?worker'
const worker = new editorWorker()
queue
interfacemodule
polyfill (#164)stream
and events
from deno std/node (#136) @talentlessguylocalLRU
and allow for memoryLRU
(#148) @jimisaacslocalLRU
FS layer (#126)Cache Interface
that is using to store temporary data like npm packages info./favicon.ico
(#132)pixi.js
, three.js
and @material-ui/core
testing by @jimisaacs (#134, #139).const Parser = require('htmlparser').Parser;
import htmlparser2 from '/v48/htmlparser2@5.0.0/es2021/htmlparser2.js'
const Parser = htmlparser2.Parser; // parser is undefined
import { Parser as htmlparser2Parser } from '/v48/htmlparser2@5.0.0/es2021/htmlparser2.js'
const Parser = htmlparser2Parser; // parser is a class
function debounce() {};
debounce.debounce = debounce;
module.exports = debounce;
export { debounce } // this was missed
export default debounce
?target
in Deno (fix #109)cache-folder
config for yarn add
resolveVersion
to support format 4.x (fix #93)?alias
and ?deps
to deps (fix #101)cjs-lexer
sever (fix #103)cjs-moudle-lexer
server invalid exports outputresolveVersion
function to support format like 4.x (fix #93)Alias
feature (#89)import useSWR from 'https://esm.sh/swr?alias=react:preact/compat'
?deps
:import useSWR from 'https://esm.sh/swr?alias=react:preact/compat&deps=preact@10.5.14'
node
build target (#84)exports
field to get entry point in package.json
es2021
build target__esModule
reserved wordtimeout
(30 seconds) for new build request, or use previous build version instead if it existsbundle
modeparseCJSModuleExports
to support json moduleNODE_ENV
to parseCJSModuleExports
module
type (#48)parseCJSModuleExports
function (use cjs-module-lexer and nodejs eval both to parse cjs exports, and ignore JSON module)NODE_ENV
to parseCJSModuleExports
functiontarget
by the user-agent
of browser automaticlly__setImmediate$
is not definedVersion Info