Skip to main content
Version: 2.22

nodejs-infer


Options controlling which dependencies will be inferred for javascript targets.

Backend: pants.backend.experimental.openapi

Config section: [nodejs-infer]

Basic options

imports

--[no-]nodejs-infer-imports
PANTS_NODEJS_INFER_IMPORTS
pants.toml
[nodejs-infer]
imports = <bool>
default: True

Infer a target's imported dependencies by parsing import statements from sources.

To ignore a false positive, you can either put // pants: no-infer-dep on the line of the import or put !{bad_address} in the dependencies field of your target.

package_json_entry_points

--[no-]nodejs-infer-package-json-entry-points
PANTS_NODEJS_INFER_PACKAGE_JSON_ENTRY_POINTS
pants.toml
[nodejs-infer]
package_json_entry_points = <bool>
default: True

Infer a package_json's dependencies by parsing entry point statements from the package.json file.

To ignore a false positive, you can put !{bad_address} in the dependencies field of the package_json target.

See https://nodejs.org/api/packages.html#package-entry-points and https://docs.npmjs.com/cli/v9/configuring-npm/package-json#browser.

Advanced options

None

Deprecated options

None

None