From 3bd4f7fe158c122d9a3965926b751b6ad6166638 Mon Sep 17 00:00:00 2001 From: Ayub-Begimkulov Date: Sun, 14 Mar 2021 15:49:41 +0300 Subject: [PATCH] update package.json and cjs entry --- package.json | 17 +++++++++++++++-- rollup.config.js | 7 +++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 2ff9d45..9a3e1c2 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,10 @@ "name": "tiny-use-debounce", "version": "1.0.0", "description": "React hooks for debouncing and throttling.", - "main": "dist/index.js", + "main": "dist/index.cjs.js", "module": "dist/index.js", "types": "dist/index.d.ts", + "sideEffects": false, "license": "MIT", "author": "Ayub Begimkulov", "scripts": { @@ -34,6 +35,15 @@ "react": ">=16.8.0 || 17.x", "react-dom": ">=16.8.0 || 17.x" }, + "keywords": [ + "use-debounce", + "use-throttle", + "tiny-use-debounce", + "debounce", + "throttle", + "react-hooks", + "react" + ], "repository": { "type": "git", "url": "https://github.com/Ayub-Begimkulov/tiny-use-debounce" @@ -41,5 +51,8 @@ "bugs": { "url": "https://github.com/Ayub-Begimkulov/tiny-use-debounce/issues" }, - "homepage": "https://github.com/Ayub-Begimkulov/tiny-use-debounce#readme" + "homepage": "https://github.com/Ayub-Begimkulov/tiny-use-debounce#readme", + "files": [ + "dist" + ] } diff --git a/rollup.config.js b/rollup.config.js index 51f87f1..ffafa75 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -23,6 +23,13 @@ const createRollupConfig = ({ modern }) => { format: "es", file: path.resolve(distDir, modern ? "index.js" : "index.ie11.js"), }, + { + format: "cjs", + file: path.resolve( + distDir, + modern ? "index.cjs.js" : "index.cjs.ie11.js" + ), + }, ], }; };