Skip to content

Commit 81e9044

Browse files
committed
feat: Export everything from index to expose types more elegantly
1 parent 6fb31dd commit 81e9044

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
"name": "react-use-modal",
33
"version": "0.0.1",
44
"description": "A custom hook for easy and quick modal management for React",
5-
"main": "dist/useModal.js",
6-
"types": "dist/useModal.d.ts",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
77
"type": "module",
8-
"files": ["dist"],
8+
"files": [
9+
"dist"
10+
],
911
"scripts": {
1012
"build": "rollup -c",
1113
"clean": "rm -rf dist",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import terser from "@rollup/plugin-terser";
44
import hookPackage from "./package.json" assert { type: "json" };
55

66
export default {
7-
input: "src/useModal.ts",
7+
input: "src/index.ts",
88
external: ["react", "react-dom"],
99
output: [
1010
{

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from "./useModal";
2+
export * from "./useModal.types";

0 commit comments

Comments
 (0)