@altack/nx-bundlefy
v0.15.0
Published
Nx executor to ensure that all the buildable dependencies of the publishable library are bundled together with the library
Downloads
766
Maintainers
Readme
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-bundlefyAlso make sure to install the required peer dependencies:
npm install -D @nrwl/js @nrwl/devkit @nrwl/workspace validate-npm-package-nameConfiguration
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-libraryRun the executor
This will ensure that all the buildable libraries are bundled as part of the library build
nx run publishable-library:bundlefyFurther reading
For a more detailed explanation, see this Stack Overflow question and the open issue in the Nx's repository
