0

In the npm documents, we read about bundledDependencies:

This defines an array of package names that will be bundled when publishing the package.

What is the meaning of publishing the package? I know that bundledDependencies are bundled in the tarball file after running npm pack. But is there any difference between bundledDependencies and normal dependencies when running npm publish and publishing the package to the npm registry?

moeinghasemi
  • 81
  • 1
  • 10
  • Does this answer your question? [Advantages of bundledDependencies over normal dependencies in npm](https://stackoverflow.com/questions/11207638/advantages-of-bundleddependencies-over-normal-dependencies-in-npm) – RobC Apr 30 '20 at 13:14
  • No, my question is about the effect of bundledDependancies on publishing the package to npm registry. (for example "npm publish"). thanks anyway. – moeinghasemi Apr 30 '20 at 15:04
  • 1
    `npm publish` essentially runs `npm pack` before publishing the package (`.tgz`) to the registry (see source code files; [publish.js](https://github.com/npm/cli/blob/36682d4482cddee0acc55e8d75b3bee6e78fff37/lib/publish.js) and [pack.js](https://github.com/npm/cli/blob/3e7ed30d6e9211e39bd93ec4e254cc5a2b159947/lib/pack.js)), so I think you've answered your own question, i.e. _"I know that bundledDependencies are bundled in the tarball file after running `npm pack`"_ – RobC Apr 30 '20 at 15:45

0 Answers0