@altack/nx-bundlefy
TypeScript icon, indicating that this package has built-in type declarations

0.15.0 • Public • Published

nx-bundlefy

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

Installation

npm install -D @altack/nx-bundlefy

Also make sure to install the required peer dependencies:

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:

{
  "$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.

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

nx run publishable-library:bundlefy

Further reading

For a more detailed explanation, see this Stack Overflow question and the open issue in the Nx's repository

Package Sidebar

Install

npm i @altack/nx-bundlefy

Weekly Downloads

698

Version

0.15.0

License

MIT

Unpacked Size

14.9 kB

Total Files

8

Last publish

Collaborators

  • guzmanoj