publish-packed v4.1.2
publish-packed
Publishes a package together with its dependencies
When publishing a package, dependencies are not bundled with the package. Although you could use bundledDependencies, you have to list all the dependencies you want to bundle.
publish-packed bundles all dependencies with your package:
- it installs all your dependencies first
it moves the
node_modulesfolder from the root of your package tolib/node_modulesWhen publishing, npm ignores the
node_modulesfolder in the root of your package. However, it packs allnode_modulesin subfolders.it escapes the
dependenciesfield in your package'spackage.json, so during installation no dependencies of your package will be installed, except optional dependencies.- it can prune
node_modules, removing markdown files, tests, configs and other resources that are not code
Limitations:
- you can use
publish-packedonly if all your source code is in thelib/directory because all your dependencies are going to be insidelib/node_modules. - you can use
publish-packedonly if your prod dependencies don't have lifecycle events likepostinstallthat should be executed during installation
Installation
<npm|pnpm|yarn> add -D publish-packedUsage
Add publish-packed to the prepublishOnly and postpublish scripts of your package.json:
"scripts": {
"prepublishOnly": "publish-packed",
"postpublish": "publish-packed"
}To publish the package, just run <npm|pnpm|yarn> publish.
License
2 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago