diff --git a/.gitignore b/.gitignore index 82dda142..c073c601 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ npm-shrinkwrap.json # coverage output coverage/ .nyc_output/ + +.npmignore diff --git a/.npmignore b/.npmignore deleted file mode 100644 index f3eaf982..00000000 --- a/.npmignore +++ /dev/null @@ -1,19 +0,0 @@ -# gitignore -npm-debug.log -node_modules -.DS_Store - -# Only apps should have lockfiles -yarn.lock -package-lock.json -npm-shrinkwrap.json - -# coverage output -coverage/ -.nyc_output/ - -bower.json -component.json -.npmignore - -.github/workflows diff --git a/package.json b/package.json index 3d6b97ba..ad7dd967 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "iconv-lite": "^0.5.1", "in-publish": "^2.0.1", "mkdirp": "^0.5.5", + "npmignore": "^0.3.0", "nyc": "^10.3.2", "object-inspect": "^1.12.0", "qs-iconv": "^1.0.4", @@ -52,6 +53,7 @@ "tape": "^5.4.0" }, "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", "prepublishOnly": "safe-publish-latest && npm run dist", "prepublish": "not-in-publish || npm run prepublishOnly", "pretest": "npm run --silent readme && npm run --silent lint", @@ -63,5 +65,13 @@ "lint": "eslint --ext=js,mjs .", "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js" }, - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "publishConfig": { + "ignore": [ + "!dist/*", + "bower.json", + "component.json", + ".github/workflows" + ] + } }