Skip to content

Commit e4a5d78

Browse files
authored
Moves the build output to dist and fixes unnecessary files getting uploaded to npm while publishing the package. (#18)
* Changed the output folder in rollup config to dist. * Updated the exports path and set the files to export in package.json
1 parent c7c66fa commit e4a5d78

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

package.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
{
22
"name": "@bigbinary/neeto-hotkeys",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "React hook for handling keyboard shortcuts, offering a customizable and platform-aware solution, supporting global and scoped modes.",
55
"exports": {
66
".": {
7-
"import": "./index.mjs",
8-
"require": "./index.cjs.js"
7+
"import": "./dist/index.mjs",
8+
"require": "./dist/index.cjs.js"
99
}
1010
},
1111
"scripts": {
1212
"prepare": "husky install",
1313
"build": "NODE_ENV=production rollup -c"
1414
},
1515
"types": "index.d.ts",
16+
"files": [
17+
"dist",
18+
"index.d.ts"
19+
],
20+
"main": "dist/index.cjs.js",
21+
"module": "dist/index.mjs",
1622
"engines": {
1723
"node": ">=18.12",
1824
"npm": ">=9",
@@ -82,6 +88,8 @@
8288
},
8389
"peerDependencies": {
8490
"ramda": "^0.29.1",
85-
"react": "^18.2.0"
91+
"react": "^18.2.0",
92+
"@bigbinary/neeto-cist": "latest",
93+
"@bigbinary/neeto-commons-frontend": "latest"
8694
}
8795
}

rollup.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ export default {
2424
output: [
2525
{
2626
inlineDynamicImports: true,
27-
file: `index.cjs.js`,
27+
file: "dist/index.cjs.js",
2828
format: "cjs",
2929
sourcemap: true,
3030
name: `neeto-hotkeys/index`,
3131
globals,
3232
},
3333
{
3434
inlineDynamicImports: true,
35-
file: `index.mjs`,
35+
file: "dist/index.mjs",
3636
format: "esm",
3737
sourcemap: true,
3838
name: `neeto-hotkeys/index`,
@@ -41,7 +41,7 @@ export default {
4141
],
4242
plugins: [
4343
// To delete previously existing bundle.
44-
cleaner({ targets: globSync(path.resolve(__dirname, buildFilesMatchPattern)) }),
44+
cleaner({ targets: globSync(path.resolve(__dirname, "dist")) }),
4545
// To automatically externalize peerDependencies in a rollup bundle.
4646
peerDepsExternal(),
4747
// To use third party modules from node_modules

0 commit comments

Comments
 (0)