2

I'm building a umd library using webpack, in my package.json I have dependency-a which I use in my code.

When I build my code using webpack, I see that dependency-a is already baked in in the dist/bundle.js, then I publish my code to npm.

When the user installs my package from npm, all the code the user needs is already in dist/bundle.js, but why does npm still transitively install the dependency-a in my package's node_modules? When will the node_modules/dependency-a in my package's directory ever be used?

Did I misunderstand something? Am I supposed to A). exclude this dependency from npm or B). make webpack not bake the dependency in in dist/bundle.js?

What are the best / most common practices?

Kevin
  • 2,775
  • 4
  • 16
  • 27

0 Answers0