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}
15Remove 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