6

I've a question though a silly one but I really need to know. If we're using axios then should I install it as dependencies or devdependencies? As I understand that webpack will bundle it in vendor file then installing it in production server as dependencies is just pointless. Please advise

Smit Ray
  • 211
  • 5
  • 14
  • 2
    Possible duplicate of [What's the difference between dependencies, devDependencies and peerDependencies in npm package.json file?](https://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies) – thanksd Jan 16 '18 at 19:36
  • Not a duplicate, but the answers there are implicitly the answers to this question. – eljefedelrodeodeljefe Sep 16 '21 at 10:20

2 Answers2

13

You should install it as a dependencies because you use it in your application, not only as a dev tool.

CodeTherapist
  • 2,776
  • 14
  • 24
2

devDependencies. Put everything that is not included in the consuming application e.g. through a compilation step into dev dependencies. This way the consumers of your package or your production install or your docker container will not include an unused dependency. Your users will thank you.

eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61