From 1fd5861b27f98f4632f2346891079081f769e645 Mon Sep 17 00:00:00 2001 From: Deepak Jose Date: Wed, 13 Mar 2024 10:27:08 +0530 Subject: [PATCH 1/2] Changed the output folder in rollup config to dist. --- rollup.config.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 9db03ad..7a65b1b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -24,7 +24,7 @@ export default { output: [ { inlineDynamicImports: true, - file: `index.cjs.js`, + file: "dist/index.cjs.js", format: "cjs", sourcemap: true, name: `neeto-hotkeys/index`, @@ -32,7 +32,7 @@ export default { }, { inlineDynamicImports: true, - file: `index.mjs`, + file: "dist/index.mjs", format: "esm", sourcemap: true, name: `neeto-hotkeys/index`, @@ -41,7 +41,7 @@ export default { ], plugins: [ // To delete previously existing bundle. - cleaner({ targets: globSync(path.resolve(__dirname, buildFilesMatchPattern)) }), + cleaner({ targets: globSync(path.resolve(__dirname, "dist")) }), // To automatically externalize peerDependencies in a rollup bundle. peerDepsExternal(), // To use third party modules from node_modules From 5ff158ed1bd87d232775f68e36db000d7d80adf2 Mon Sep 17 00:00:00 2001 From: Deepak Jose Date: Wed, 13 Mar 2024 10:27:58 +0530 Subject: [PATCH 2/2] Updated the exports path and set the files to export in package.json --- package.json | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index ec29979..163c5ca 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "@bigbinary/neeto-hotkeys", - "version": "1.0.2", + "version": "1.0.3", "description": "React hook for handling keyboard shortcuts, offering a customizable and platform-aware solution, supporting global and scoped modes.", "exports": { ".": { - "import": "./index.mjs", - "require": "./index.cjs.js" + "import": "./dist/index.mjs", + "require": "./dist/index.cjs.js" } }, "scripts": { @@ -13,6 +13,12 @@ "build": "NODE_ENV=production rollup -c" }, "types": "index.d.ts", + "files": [ + "dist", + "index.d.ts" + ], + "main": "dist/index.cjs.js", + "module": "dist/index.mjs", "engines": { "node": ">=18.12", "npm": ">=9", @@ -82,6 +88,8 @@ }, "peerDependencies": { "ramda": "^0.29.1", - "react": "^18.2.0" + "react": "^18.2.0", + "@bigbinary/neeto-cist": "latest", + "@bigbinary/neeto-commons-frontend": "latest" } }