Skip to content

Commit 292c091

Browse files
committed
[meta] Remove non-essential files from npm package
~3x reduction in package size. ~5x reduction in on-disk size https://docs.npmjs.com/cli/v11/configuring-npm/package-json#files Reverts f81ece6 Removes: * .github/ * example/ * test/ * .eslintrc * .nycrc * CHANGELOG.md ``` npm pack --dry-run ``` **Before** ``` === Tarball Details === package size: 16.6 kB unpacked size: 59.0 kB total files: 26 ``` **After** ``` === Tarball Contents === 1.1kB LICENSE 3.8kB README.md 6.3kB index.js 1.6kB package.json === Tarball Details === package size: 4.9 kB unpacked size: 12.9 kB total files: 4 ```
1 parent 30b5621 commit 292c091

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "parse argument options",
55
"main": "index.js",
66
"scripts": {
7-
"prepack": "npmignore --auto --commentLines=auto",
87
"prepublishOnly": "safe-publish-latest",
98
"prepublish": "not-in-publish || npm run prepublishOnly",
109
"lint": "eslint --ext=js,mjs .",
@@ -15,6 +14,9 @@
1514
"version": "auto-changelog && git add CHANGELOG.md",
1615
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
1716
},
17+
"files": [
18+
"index.js"
19+
],
1820
"testling": {
1921
"files": "test/*.js"
2022
},
@@ -44,7 +46,6 @@
4446
"encoding": "^0.1.13",
4547
"eslint": "=8.8.0",
4648
"in-publish": "^2.0.1",
47-
"npmignore": "^0.3.1",
4849
"nyc": "^10.3.2",
4950
"safe-publish-latest": "^2.0.0",
5051
"tape": "^5.9.0"
@@ -59,10 +60,5 @@
5960
"commitLimit": false,
6061
"backfillLimit": false,
6162
"hideCredit": true
62-
},
63-
"publishConfig": {
64-
"ignore": [
65-
".github/workflows"
66-
]
6763
}
6864
}

0 commit comments

Comments
 (0)