Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/publish-packed
Publishes a package together with its dependencies
https://github.com/zkochan/publish-packed
bundle pack publishing
Last synced: 2 months ago
JSON representation
Publishes a package together with its dependencies
- Host: GitHub
- URL: https://github.com/zkochan/publish-packed
- Owner: zkochan
- License: mit
- Created: 2017-01-29T23:28:55.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2024-07-07T01:17:59.000Z (6 months ago)
- Last Synced: 2024-10-24T03:37:36.709Z (3 months ago)
- Topics: bundle, pack, publishing
- Language: TypeScript
- Homepage:
- Size: 564 KB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# publish-packed
[![npm version](https://img.shields.io/npm/v/publish-packed.svg)](https://www.npmjs.com/package/publish-packed)
[![Status](https://travis-ci.org/zkochan/publish-packed.svg?branch=master)](https://travis-ci.org/zkochan/publish-packed "See test builds")> Publishes a package together with its dependencies
When publishing a package, dependencies are not bundled with the package.
Although you could use [bundledDependencies](https://docs.npmjs.com/files/package.json#bundleddependencies),
you have to list all the dependencies you want to bundle.`publish-packed` bundles all dependencies with your package:
1. it installs all your dependencies first
1. it moves the `node_modules` folder from the root of your package to `lib/node_modules`When publishing, npm ignores the `node_modules` folder in the root of your package. However,
it packs all `node_modules` in subfolders.
1. it escapes the `dependencies` field in your package's `package.json`, so during installation
no dependencies of your package will be installed, except optional dependencies.
1. it can prune `node_modules`, removing markdown files, tests, configs and other resources that are not codeLimitations:
1. you can use `publish-packed` only if all your source code is in the `lib/` directory
because all your dependencies are going to be inside `lib/node_modules`.
2. you can use `publish-packed` only if your prod dependencies don't have lifecycle events like `postinstall`
that should be executed during installation## Installation
```
add -D publish-packed
```## Usage
Add `publish-packed` to the `prepublishOnly` and `postpublish` scripts of your `package.json`:
```json
"scripts": {
"prepublishOnly": "publish-packed",
"postpublish": "publish-packed"
}
```To publish the package, just run ` publish`.
## License
[MIT](LICENSE) © [Zoltan Kochan](https://www.kochan.io)