Builds using SWC.
Options can be configured in project.json
when defining the executor, or when invoking it. Read more about how to configure targets and executors here: https://nx.dev/reference/project-configuration#targets.
@nx/js:swc
can inline non-buildable libraries by opt-in to Inlining mode with external
option.
libs/ts-lib/project.json
{ "build": { "executor": "@nx/js:swc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", "tsConfig": "libs/ts-lib/tsconfig.lib.json", "assets": ["libs/ts-lib/*.md"], "external": "all" } } }
❯
npx nx build ts-lib --external=all
@nx/js:swc
can also inline buildable libraries by setting external: 'none'
libs/ts-lib/project.json
{ "build": { "executor": "@nx/js:swc", "options": { "outputPath": "dist/libs/ts-lib", "main": "libs/ts-lib/src/index.ts", "tsConfig": "libs/ts-lib/tsconfig.lib.json", "assets": ["libs/ts-lib/*.md"], "external": "none" } } }
❯
npx nx build ts-lib --external=none
OptionsThe name of the main entry-point file.
The output path of the generated files.
The path to the Typescript configuration file.
Additional entry-points to add to exports field in the package.json file.
generateExportsFieldexports
Update the output package.json file's 'exports' field. This field is used by Node and bundles.
Whether to skip TypeScript type checking.
Array<
oneOf [
object , string]
>
Default: []
Remove previous output before build.
Array<string>
Default: [build]
List of target names that annotate a build target for a project
The path to the SWC configuration file. Default: .swcrc
Array<anything>
Default: [./src/**/.*.spec.ts$,./**/.*.spec.ts$,./src/**/jest-setup.ts$,./**/jest-setup.ts$,./**/.*.js$]
List of SWC Glob/Regex to be excluded from compilation (https://swc.rs/docs/configuration/compilation#exclude).
Remove leading directory from output (e.g. src). See: https://swc.rs/docs/usage/cli#--strip-leading-paths
Enable re-building when files change.
generateLockfileInternal
Generate a lockfile (e.g. package-lock.json) that matches the workspace lockfile to ensure package versions match.
oneOf [string, Array<string>]
A list projects to be treated as external. This feature is experimental
Make sure all dependencies are buildable by running nx g @nx/js:setup-build
. This option will be removed in Nx 20.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4