@arthurgubaidullin/nx-embed-dependencies
Version:
This plugin for [Nx](https://nx.dev) helps injecting local dependencies into a package.
70 lines (48 loc) • 1.14 kB
Markdown
This plugin for [Nx](https://nx.dev) helps injecting local dependencies into a package.
Using npm:
`npm install @arthurgubaidullin/nx-embed-dependencies --save-dev`
Add a target to `project.json` to the library you want to build with dependencies.
```jsonc
{
// ...
"targets": {
// ...
"embed-dependencies": {
"executor": "@arthurgubaidullin/nx-embed-dependencies:run",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/packages/lib-with-dependencies"
}
}
}
// ...
}
```
Also update your `nx.json`.
```jsonc
{
// ...
"targetDefaults": {
// ...
"embed-dependencies": {
"dependsOn": ["build"]
// ...
}
}
}
```
If you are using [grouped libraries](https://nx.dev/more-concepts/grouping-libraries), then their names must be valid.
**Correct**
`@workspace/commom-my-lib`
**Incorrect**
`@workspace/commom/my-lib`
When creating a project in folder, use the `--importPath` option.
MIT.