Currently, the entire repository contents are published to NPM. The package can be optimized by excluding unnecessary files/folders/metadata when publishing to NPM.
The distributed package size can be optimized by using the package.json#files property. It's an allowlist of files or folders for publishing.
This PR proposes allowlisting dist and src folders. Note that some files are automatically included and do not need to be specified (e.g., README, LICENSE).
Currently, the entire repository contents are published to NPM. The package can be optimized by excluding unnecessary files/folders/metadata when publishing to NPM.
The distributed package size can be optimized by using the
package.json#files
property. It's an allowlist of files or folders for publishing.This PR proposes allowlisting
dist
andsrc
folders. Note that some files are automatically included and do not need to be specified (e.g., README, LICENSE).Running
npm pack
shows the following comparison.Before
main
branchnpm i; npm run build
npm pack
After
npm i; npm run build
npm pack
Result
Consequently, the size of the publish package (both packed/unpacked) can be dramatically reduced.