Configuring Published Files
When publishing a package to a registry, the default is to publish everything in the package's source directory. This is not always optimal, since there are often files only relevant for development, such as tests and configuration files, and it could be that you first compile your source files and output them to a centralized location in a monorepo setup.
Lerna provides a number of configuration options to ensure that only the appropriate files are packed and published to a registry.
"files"
and .gitignore
Lerna always publishes using npm's tooling, and it has a few built in ways to include or exclude files. The easiest way to configure which files are included in the published package are via the "files" property in package.json
and .gitignore
. See the npm documentation for more information on how npm recognizes files for publishing.