From b254d7dda6e6f86ac9f571075a2bc0fa4c1a6094 Mon Sep 17 00:00:00 2001 From: X Date: Sat, 26 Mar 2022 17:47:00 +0800 Subject: [PATCH] v74 --- CHANGELOG.md | 15 +++++++++++++++ README.md | 2 +- server/consts.go | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2f498db..62cca802 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## v74 + +- Support `?no-require` flag, with this option you can ignore the `require(...)` call in ESM packages. To support logic like below: + ```ts + // index.mjs + + let depMod; + try { + depMod = await import("/path") + } finally { + // `?no-require` will skip next line when resolving + depMod = require("/path") + } + ``` + ## v73 - Fix types dependency path (close [#287](https://github.com/esm-dev/esm.sh/issues/287)) diff --git a/README.md b/README.md index 5a725f62..d1f0c93f 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ import unescape from "https://esm.sh/lodash/unescape?no-check" Since we update esm.sh server frequently, sometime we may break packages that work fine previously by mistake, the server will rebuild all modules when the patch pushed. To avoid this, you can **pin** the build version by the `?pin=BUILD_VERSON` query. This will give you an **immutable** cached module. ```javascript -import React from "https://esm.sh/react@17.0.2?pin=v73" +import React from "https://esm.sh/react@17.0.2?pin=v74" ``` ## Global CDN diff --git a/server/consts.go b/server/consts.go index 0a5b1e53..56a076ea 100644 --- a/server/consts.go +++ b/server/consts.go @@ -1,7 +1,7 @@ package server // ems.sh version -const VERSION = 73 +const VERSION = 74 const ( pkgCacheTimeout = 10 * 60 // 10 minutes