Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is "bundleDependencies": false valid? #2303

Closed
aeschli opened this issue Nov 19, 2019 · 2 comments
Closed

Is "bundleDependencies": false valid? #2303

aeschli opened this issue Nov 19, 2019 · 2 comments

Comments

@aeschli
Copy link

aeschli commented Nov 19, 2019

node 12.13.0

mkdir test
cd test
npm init -y
npm install cheerio

After that, all packages.json files in node_modules directory have bundleDependencies: false.
But not the main package.json of the project in root directory.

https://docs.npmjs.com/files/package.json#bundleddependencies does not mention that bundleddependencies can also be boolean, nor the schema at https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json

Should the schema be updated?

Original issue: microsoft/vscode#84972

@MasterOdin
Copy link

Looking into this in schemastore, it seems like npm allows for any falsy value for bundleDependencies, not just explicitly false, though that is what npm itself inserts into installed package.json files. The usage of it roughly follows these three patterns in the handful of places:

  1. if (!pkg.bundledDependencies)
  2. let bundled = pkg.bundledDependencies; if (!Array.isArray(bundled)) bundled = [];
  3. let bundled = pkg.bundledDependencies || [];

@gireeshpunathil
Copy link
Member

closing as answered, pls reopen if there is anything outstanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants