diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e842b781..9413e83f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## v104 + +- Rewrite `FileSystem` interface of storage. +- Fix submodule build with `exports` in package.json (close [#497](https://github.com/ije/esm.sh/issues/497)) +- Fix es5-ext weird `/#/` path (close [#502](https://github.com/ije/esm.sh/issues/502)) + ## v103 - Add `inject` argument for worker factory diff --git a/README.md b/README.md index 6db727107..e93d36bc1 100644 --- a/README.md +++ b/README.md @@ -208,7 +208,7 @@ import unescape from "https://esm.sh/lodash/unescape?no-dts" 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=v103" +import React from "https://esm.sh/react@17.0.2?pin=v104" ``` ## Global CDN diff --git a/server/build.go b/server/build.go index cbc19b478..8c28db986 100644 --- a/server/build.go +++ b/server/build.go @@ -343,7 +343,7 @@ func (task *BuildTask) build(tracing *stringSet) (esm *ESM, err error) { // splits modules based on the `exports` defines in package.json, // see https://nodejs.org/api/packages.html - if (strings.HasPrefix(specifier, "./") || strings.HasPrefix(specifier, "../") || specifier == "..") && !strings.HasSuffix(specifier, ".js") { + if (strings.HasPrefix(specifier, "./") || strings.HasPrefix(specifier, "../") || specifier == "..") && !strings.HasSuffix(specifier, ".js") && !strings.HasSuffix(specifier, ".mjs") && !strings.HasSuffix(specifier, ".json") { fullpath := path.Join(path.Dir(args.Importer), specifier) // in macOS, the dir `/private/var/` is equal to `/var/` if strings.HasPrefix(fullpath, "/private/var/") { @@ -621,7 +621,6 @@ esbuild: importPath = name } // sub module - fmt.Println(task.Pkg, name) if importPath == "" && strings.HasPrefix(name, task.Pkg.Name+"/") { submodule := strings.TrimPrefix(name, task.Pkg.Name+"/") subPkg := Pkg{ diff --git a/server/consts.go b/server/consts.go index 30ae1e8ee..a5ae73a07 100644 --- a/server/consts.go +++ b/server/consts.go @@ -2,7 +2,7 @@ package server const ( // esm.sh build version - VERSION = 103 + VERSION = 104 nodejsMinVersion = 16 denoStdVersion = "0.173.0" nodejsLatestLTS = "16.18.1"