Skip to main content
Version: 2.26 (prerelease)

npm_distribution


A publishable npm registry distribution, typically a gzipped tarball of the sources and any resources, but omitting the lockfile.

Generated using the projects package manager pack implementation.

Backend: pants.backend.experimental.javascript


description

str | None
default: None

A human-readable description of the target.

Use pants list --documented :: to see all targets with descriptions.

output_path

str | None
default: '${spec_path_normalized}/${target_name_normalized}${file_suffix}'

Where the built asset should be located.

This field supports the following template replacements:

  • ${spec_path_normalized}: The path to the target's directory ("spec path") with forward slashes replaced by dots.

  • ${target_name_normalized}: The target's name with paramaterizations escaped by replacing dots with underscores.

  • ${file_suffix}: For target's which produce single file artifacts, this is the file type suffix to use with a leading dot, and is empty otherwise when not applicable.

If undefined, this will use the path to the BUILD file, followed by the target name. For example, src/python/project:app would be src.python.project/app.ext. This behavior corresponds to the default template: ${spec_path_normalized}/${target_name_normalized}${file_suffix}

When running pants package, this path will be prefixed by --distdir (e.g. dist/).

Warning: setting this value risks naming collisions with other package targets you may have.

source

str | None
default: 'package.json'

A single file that belongs to this target.

Path is relative to the BUILD file's directory, e.g. source='example.ext'.

tags

Iterable[str] | None
default: None

Arbitrary strings to describe a target.

For example, you may tag some test targets with 'integration_test' so that you could run pants --tag='integration_test' test :: to only run on targets with that tag.