# @altack/nx-bundlefy

> Nx executor to ensure that all the buildable dependencies of the publishable library are bundled together with the library

Latest version **0.15.0** (published 2023-10-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @altack/nx-bundlefy
pnpm add @altack/nx-bundlefy
yarn add @altack/nx-bundlefy
bun add @altack/nx-bundlefy
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.15.0 |
| Published | 2023-10-10 |
| First published | 2023-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jose Guzman |
| Maintainers | guzmanoj |
| Keywords | nx, bundle, publishable library, executor, tsc |

## Links

- npm: https://www.npmjs.com/package/@altack/nx-bundlefy
- Repository: https://github.com/altack/nx-bundlefy
- Homepage: https://github.com/altack/nx-bundlefy#readme
- Issues: https://github.com/altack/nx-bundlefy/issues
- npm.io page: https://npm.io/package/@altack/nx-bundlefy

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.5.0

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.15.0 (latest) — 2023-10-10
- 0.16.0 — 2023-07-31
- 0.0.2 — 2023-05-16
- 0.0.1 — 2023-05-16

## README

# nx-bundlefy

Nx executor to ensure that all the buildable dependencies of a publishable library are part of the final bundle.

## Installation

```bash
npm install -D @altack/nx-bundlefy
```

Also make sure to install the required peer dependencies:

```bash
npm install -D @nrwl/js @nrwl/devkit @nrwl/workspace validate-npm-package-name
```

## Configuration

To use the executor, make sure to adjust your publishable library's `project.json`:

```json
{
  "$schema": "../../node_modules/nx/schemas/project-schema.json",
  "sourceRoot": "libs/publishable-library/src",
  "targets": {
    "bundlefy": {
      "executor": "@altack/nx-bundlefy:run",
      "configurations": {},
      "dependsOn": ["build"],
      "outputs": ["{options.outputFile}"]
    },
    "build": {
      ...
    }
  }
}
```

Also make sure that buildable & publishable libraries are created using the `--import-path` modifier.

```bash
nx g lib my-library --buildable --import-path @org/my-library
```

## Run the executor

This will ensure that all the buildable libraries are bundled as part of the library build

```bash
nx run publishable-library:bundlefy
```

## Further reading
For a more detailed explanation, see this [Stack Overflow question](https://stackoverflow.com/questions/73551220/how-to-publish-nx-library-with-its-dependencies-bundled/) and the open issue in the [Nx's repository](https://github.com/nrwl/nx/issues/4620)

---
_Source: https://npm.io/package/@altack/nx-bundlefy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
