3

What is the difference of having the packages under the dependencies or devDependencies in the package.json?

How does that impact in the final build?

Sounds quite simple, but I don't have it clear to which packages to put in each section. Even similar addon's documentations vary as well, some say to use --save and others --save-dev, which confuses me.

Alvaro Castro
  • 811
  • 1
  • 9
  • 26

2 Answers2

11

In an ember app all your dependencies will go under devDependencies since you build the app via the ember cli and you do not include the app in another project.

For addons the story is a bit different, if your addon exposes any functionality from a package then that package has to be under dependencies.

Patsy Issa
  • 11,113
  • 4
  • 55
  • 74
0

Take a look in your package.json file and you will see two types of dependencies. One is called devDependencies(usually modules needed for local development) and one is called dependencies (dependencies used in production or that are integral to the given project). The --save flag adds your dependencies to the dependencies object of your package.json file and --save-dev adds your dependencies to the devDependencies. They're separated for convenience.

Edit: This question has been answered before, but the tldr; is, it doesn't affect your production build. Hope that this helps.

user38064
  • 1
  • 1
  • 1
  • 1