From 71f46fae5dc86b792f8c1734dd819e03478cb49d Mon Sep 17 00:00:00 2001 From: samshara Date: Wed, 3 Jan 2024 17:21:49 +0545 Subject: [PATCH] fix: upgrade `fujs` and use `exports` to define multiple entry points --- lib/package.json | 12 ++++++++++-- lib/rollup.config.js | 1 + storybook/package.json | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/package.json b/lib/package.json index cc33b31..7d6e575 100644 --- a/lib/package.json +++ b/lib/package.json @@ -6,8 +6,16 @@ "/build" ], "type": "module", - "main": "build/cjs/index.js", + "main": "build/cjs/index.cjs", "module": "build/esm/index.js", + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./build/esm/index.d.ts", + "import": "./build/esm/index.js", + "require": "./build/cjs/index.cjs" + } + }, "typings": "build/esm/index.d.ts", "scripts": { "prepare": "install-peers", @@ -32,7 +40,7 @@ "homepage": "https://github.com/toggle-corp/toggle-form#readme", "dependencies": { "@babel/runtime-corejs3": "^7.22.3", - "@togglecorp/fujs": "^2.0.0" + "@togglecorp/fujs": "^2.1.1" }, "peerDependencies": { "react": "^18.2.0", diff --git a/lib/rollup.config.js b/lib/rollup.config.js index 6067ae4..bb9e706 100644 --- a/lib/rollup.config.js +++ b/lib/rollup.config.js @@ -36,6 +36,7 @@ const OUTPUT_DATA = [ { dir: 'build/cjs', format: 'cjs', + entryFileNames: '[name].cjs' }, { dir: 'build/esm', diff --git a/storybook/package.json b/storybook/package.json index 74b32e1..f938611 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -14,7 +14,7 @@ "author": "", "license": "ISC", "dependencies": { - "@togglecorp/fujs": "^2.0.0", + "@togglecorp/fujs": "^2.1.1", "@togglecorp/toggle-form": "^2.0.3", "@togglecorp/toggle-ui": "^0.15.0", "react": "^18.2.0",