Copies Workspace Modules into the output directory after a build to prepare it for use with Docker or alternatives.
@nx/js
Package reference
Here is a list of all the executors, generators and migrations available from this package.
Executors
Build a project using TypeScript.
Build a project using SWC.
Execute a Node application.
Creates a pruned lockfile based on the project dependencies and places it into the output directory.
release-publishInternal
DO NOT INVOKE DIRECTLY WITH
nx run
. Usenx release publish
instead.Start local registry with verdaccio
Generators
Create a library
initInternal
Initialize a TS/JS workspace.
Convert a TypeScript library to compile with SWC.
release-versionInternal
DO NOT INVOKE DIRECTLY WITH
nx generate
. Usenx release version
instead.Setup Verdaccio for local package management.
setup-build generator
typescript-syncInternal
Synchronize TypeScript project references based on the project graph
Setup Prettier as the formatting tool.
Migrations
22.0.x
21.5.x
21.2.x
20.7.x
20.5.x
20.4.x
20.2.x
19.5.x
19.2.x
19.0.x
remove-external-options-from-js-executors
Remove the deprecated `external` and `externalBuildTargets` options from the `@nx/js:swc` and `@nx/js:tsc` executors.
Remove the external
and externalBuildTargets
Options from the @nx/js:swc
and @nx/js:tsc
Executors
Remove the deprecated external
and externalBuildTargets
options from the @nx/js:swc
and @nx/js:tsc
executors. These options were used for inlining dependencies, which was an experimental feature and has been deprecated for a long time. The migration only removes the options from the project configuration and target defaults. If you rely on inlining dependencies, you need to make sure they are all buildable or use a different build tool that supports bundling.
Sample Code Changes
Remove external
and externalBuildTargets
from the @nx/js:swc
or @nx/js:tsc
executor options in project configuration.
1{
2 "targets": {
3 "build": {
4 "executor": "@nx/js:swc",
5 "options": {
6 "main": "libs/my-lib/src/index.ts",
7 "outputPath": "dist/libs/my-lib",
8 "tsConfig": "libs/my-lib/tsconfig.lib.json",
9 "external": ["react", "react-dom"],
10 "externalBuildTargets": ["build"]
11 }
12 }
13 }
14}
15
Remove external
and externalBuildTargets
from the @nx/js:swc
or @nx/js:tsc
executor target defaults in nx.json
.
1{
2 "targetDefaults": {
3 "@nx/js:swc": {
4 "options": {
5 "main": "{projectRoot}/src/index.ts",
6 "outputPath": "dist/{projectRoot}",
7 "tsConfig": "{projectRoot}/tsconfig.lib.json",
8 "external": "all",
9 "externalBuildTargets": ["build"]
10 }
11 }
12 }
13}
14
migrate-development-custom-condition
Migrate the legacy 'development' custom condition to a workspace-unique custom condition name.
Migrate development
custom condition to unique workspace-specific name
Replace the TypeScript development
custom condition with a unique workspace-specific name to avoid conflicts when consuming packages in other workspaces.
Examples
The migration will update the custom condition name in both tsconfig.base.json
and all workspace package.json files that use the development
custom condition:
1{
2 "compilerOptions": {
3 "customConditions": ["development"]
4 }
5}
6
The migration also updates package.json
files that use the development
condition in their exports
field and point to TypeScript files:
1{
2 "name": "@myorg/my-lib",
3 "exports": {
4 ".": {
5 "development": "./src/index.ts",
6 "default": "./dist/index.js"
7 }
8 }
9}
10
If the custom condition is not set to ["development"]
or the package.json
's exports
field doesn't point to TypeScript files, the migration will not modify the configuration:
1{
2 "name": "@myorg/my-lib",
3 "exports": {
4 ".": {
5 "development": "./dist/index.js",
6 "default": "./dist/index.js"
7 }
8 }
9}
10
21.5.0-package-updates
Requires
Name | Version |
---|---|
typescript | >=5.8.0 <5.9.0 |
Packages
Name | Version | Always Add to package.json |
---|---|---|
typescript | ~5.9.2 | Update only |
21.2.0-package-updates
Requires
Name | Version |
---|---|
typescript | >=5.7.0 <5.8.0 |
Packages
Name | Version | Always Add to package.json |
---|---|---|
typescript | ~5.8.2 | Update only |
20.7.1-beta.0-package-updates
Packages
Name | Version | Always Add to package.json |
---|---|---|
@swc/cli | ~0.6.0 | Update only |
20.5.0-package-updates
Packages
Name | Version | Always Add to package.json |
---|---|---|
verdaccio | ^6.0.5 | Update only |
20.4.0-package-updates
Requires
Name | Version |
---|---|
typescript | >=5.6.0 <5.7.0 |
Packages
Name | Version | Always Add to package.json |
---|---|---|
typescript | ~5.7.2 | Update only |
20.2.0-package-updates
Requires
Name | Version |
---|---|
typescript | >=5.5.0 <5.6.0 |
Packages
Name | Version | Always Add to package.json |
---|---|---|
typescript | ~5.6.2 | Update only |
19.5.1-package-updates
Requires
Name | Version |
---|---|
typescript | >=5.4.0 <5.5.0 |
Packages
Name | Version | Always Add to package.json |
---|---|---|
typescript | ~5.5.2 | Update only |
19.2.0-package-updates
Packages
Name | Version | Always Add to package.json |
---|---|---|
@swc/core | ~1.5.7 | Update only |
@swc/helpers | ~0.5.11 | Update only |
@swc-node/register | ~1.9.1 | Update only |
19.0.0-package-updates
Packages
Name | Version | Always Add to package.json |
---|---|---|
@swc/cli | ~0.3.12 | Update only |