Skip to content

Commit

Permalink
fix(core): set module export fields (#1297)
Browse files Browse the repository at this point in the history
* fix(core): set module export fields

* chore: add changeset
  • Loading branch information
siddsriv authored Jun 4, 2024
1 parent 63207bc commit f9c5008
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-bulldogs-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@smithy/core": minor
---

adds a module exports field in core
2 changes: 2 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/core/scripts/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit f9c5008

Please sign in to comment.