From f9c50081b11d9fbb0b8ffe95a16d7fe7f09f80b5 Mon Sep 17 00:00:00 2001 From: sid <48153483+siddsriv@users.noreply.github.com> Date: Tue, 4 Jun 2024 12:40:28 -0400 Subject: [PATCH] fix(core): set module export fields (#1297) * fix(core): set module export fields * chore: add changeset --- .changeset/rare-bulldogs-battle.md | 5 +++++ packages/core/package.json | 2 ++ packages/core/scripts/lint.js | 1 + 3 files changed, 8 insertions(+) create mode 100644 .changeset/rare-bulldogs-battle.md diff --git a/.changeset/rare-bulldogs-battle.md b/.changeset/rare-bulldogs-battle.md new file mode 100644 index 00000000000..c7061ee01de --- /dev/null +++ b/.changeset/rare-bulldogs-battle.md @@ -0,0 +1,5 @@ +--- +"@smithy/core": minor +--- + +adds a module exports field in core diff --git a/packages/core/package.json b/packages/core/package.json index 3cd6a60a813..38136c74ca5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -18,12 +18,14 @@ "types": "./dist-types/index.d.ts", "exports": { ".": { + "module": "./dist-es/index.js", "node": "./dist-cjs/index.js", "import": "./dist-es/index.js", "require": "./dist-cjs/index.js", "types": "./dist-types/index.d.ts" }, "./package.json": { + "module": "./package.json", "node": "./package.json", "import": "./package.json", "require": "./package.json" diff --git a/packages/core/scripts/lint.js b/packages/core/scripts/lint.js index 52157545cba..2a47a91921b 100644 --- a/packages/core/scripts/lint.js +++ b/packages/core/scripts/lint.js @@ -20,6 +20,7 @@ for (const submodule of submodules) { if (!pkgJson.exports[`./${submodule}`]) { errors.push(`${submodule} submodule is missing exports statement in package.json`); pkgJson.exports[`./${submodule}`] = { + module: `./dist-es/submodules/${submodule}/index.js`, node: `./dist-cjs/submodules/${submodule}/index.js`, import: `./dist-es/submodules/${submodule}/index.js`, require: `./dist-cjs/submodules/${submodule}/index.js`,