by c0n5pir4cy · 3y ago · 0 comments
NPMs package.json has a `files` field which allows you to define which files are included on an npm install: https://docs.npmjs.com/cli/v6/configuring-npm/package-json#f....
This also extends to an .npmignore file that works similar to a .gitignore file.
Compare https://github.com/express-rate-limit/express-rate-limit/blo... to https://www.npmjs.com/package/express-rate-limit?activeTab=c...
Agree with you about the other points.
Having all of this stuff makes it possible to ctrl+click on functions in my libraries and read the corresponding source code. That’s a godsend during development - well worth a few extra kb of files in the npm module.
tsconfig.json:
"declaration": true,
"declarationMap": true,
"sourceMap": true,
...
package.json (assuming typescript compiles src/ to dist/): "files": [
"dist/*",
"src/*"
],