rules_js icon indicating copy to clipboard operation
rules_js copied to clipboard

[FR]: npm_package option to not collect transitive :node_module/pkgs

Open jbedard opened this issue 1 year ago • 0 comments

What is the current behavior?

All transitive npm packages within npm_package(srcs) get collected and put into the .aspect_rules_js/{pkg}@0.0.0/node_modules/*. Of those transitive packages include multiple versions of a package under the same name it will fail due to conflicting versions.

When purely using package.json as the source of truth for dependencies between packages this can be confusing.

Describe the feature

Add a flag to npm_package such as collect_transitive_npm_deps = False to disable this behaviour and only include packages directly within the npm_package(data).

For example npm_package(data = [":node_modules"]) would include all direct npm dependencies of the package and no extra packages will be included no matter what is in the transitive npm_package(srcs).

jbedard avatar Aug 16 '24 21:08 jbedard