From 9fc1cf993af43a0bdfeafe0d6810e14f7f712b60 Mon Sep 17 00:00:00 2001 From: Chinh Le Date: Wed, 27 Dec 2023 12:33:03 +0700 Subject: [PATCH] fix: module export entry --- .changeset/lovely-berries-pull.md | 6 ++++++ .github/workflows/size.yml | 4 ++++ .nvmrc | 1 + packages/hooks/package.json | 2 +- packages/utils/package.json | 2 +- tsdx.config.base.js | 2 +- 6 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changeset/lovely-berries-pull.md create mode 100644 .nvmrc diff --git a/.changeset/lovely-berries-pull.md b/.changeset/lovely-berries-pull.md new file mode 100644 index 0000000..434e096 --- /dev/null +++ b/.changeset/lovely-berries-pull.md @@ -0,0 +1,6 @@ +--- +'@dwarvesf/react-hooks': patch +'@dwarvesf/react-utils': patch +--- + +Fix module exports diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index b665848..a6625b0 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -7,6 +7,10 @@ jobs: runs-on: ubuntu-latest steps: + - name: Setup Node.js 16 + uses: actions/setup-node@v4 + with: + node-version: 16 - uses: pnpm/action-setup@v2 with: version: 8.5.1 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..6f7f377 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16 diff --git a/packages/hooks/package.json b/packages/hooks/package.json index efe645d..a659a13 100644 --- a/packages/hooks/package.json +++ b/packages/hooks/package.json @@ -16,7 +16,7 @@ "lint": "tsdx lint" }, "main": "dist/index.js", - "module": "dist/react.esm.js", + "module": "dist/index.mjs", "typings": "dist/index.d.ts", "files": [ "README.md", diff --git a/packages/utils/package.json b/packages/utils/package.json index 51cea3c..173a553 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -16,7 +16,7 @@ "lint": "tsdx lint" }, "main": "dist/index.js", - "module": "dist/utils.esm.js", + "module": "dist/index.mjs", "typings": "dist/index.d.ts", "files": [ "README.md", diff --git a/tsdx.config.base.js b/tsdx.config.base.js index 8371afc..1c82a3b 100644 --- a/tsdx.config.base.js +++ b/tsdx.config.base.js @@ -5,7 +5,7 @@ module.exports = { config.output = { ...config.output, dir: 'dist/', - entryFileNames: '[name].esm.js', + entryFileNames: '[name].mjs', } delete config.output.file }