Skip to content

Commit

Permalink
build: support ES modules
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador committed Sep 27, 2024
1 parent e1d0cd9 commit 7752565
Show file tree
Hide file tree
Showing 2 changed files with 522 additions and 7 deletions.
18 changes: 16 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,19 @@
"version": "17.5.1",
"description": "Collection of React Hooks",
"main": "lib/index.js",
"module": "esm/index.js",
"module": "esm/index.mjs",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./esm/index.mjs",
"require": "./lib/index.js"
},
"./*": {
"types": "./lib/*.d.ts",
"import": "./esm/*.mjs",
"require": "./lib/*.js"
}
},
"sideEffects": false,
"files": [
"lib/",
Expand All @@ -21,7 +33,7 @@
"lint:fix": "yarn lint --fix",
"lint:types": "tsc --noEmit",
"build:cjs": "tsc",
"build:es": "tsc -m esNext --outDir esm",
"build:es": "tsup --format esm --out-dir esm --clean src",
"build": "yarn build:cjs && yarn build:es",
"clean": "rimraf lib storybook-static esm",
"storybook": "start-storybook -p 6008",
Expand Down Expand Up @@ -81,6 +93,7 @@
"@storybook/addon-notes": "5.3.21",
"@storybook/addon-options": "5.3.21",
"@storybook/react": "6.4.9",
"@swc/core": "^1.7.26",
"@testing-library/react": "12.1.2",
"@testing-library/react-hooks": "7.0.2",
"@types/jest": "27.5.2",
Expand Down Expand Up @@ -124,6 +137,7 @@
"ts-jest": "26.5.6",
"ts-loader": "8.4.0",
"ts-node": "10.9.2",
"tsup": "^8.3.0",
"typescript": "4.1.5"
},
"config": {
Expand Down
Loading

0 comments on commit 7752565

Please sign in to comment.