8

Ember CLI applications have a package.json that lists everything as a dev dependency. Even stuff that is needed in the app's production version. For instance packages like ember and ember-data are installed as devdependencies.

As a reference, here's a sample of what I'm talking about: https://github.com/ember-cli/ember-new-output/blob/master/package.json#L17-L38

What's the reason for this?

Ernesto
  • 3,837
  • 6
  • 35
  • 56
  • So that you as a developer could choose what would be the real package that would be dealing with those dependencies? In case it is a real dependency for you, you should add those packages as a dependency for your own package.json – Icepickle Feb 10 '17 at 12:18
  • 3
    Because they are not needed after the build. – Lux Feb 10 '17 at 14:55

1 Answers1

6

In the context of application:

As @Lux mentioned in the comments, you don't need them after the build.

The output of the application is the build, that is supposed to be the final product. Further, you generally don't depend on another application. You generally depend on a package or an addon.

In the context of addons:

I think there is an opinion to display all of the addon dependencies of an application at the application's package.json file. By doing this way, you can prevent that an addon unintentially adds a js file to the build.

As a result, the ember way of managing dependencies is to leave all of your dependencies at your devDependencies and add all of the dependencies of the addon to the application's package.json with default blueprints. So the end user can tune them.

Community
  • 1
  • 1
ykaragol
  • 6,139
  • 3
  • 29
  • 56
  • If you create an addon the ember CLI will initially complain. Telling you to change the package.json similar to this: "dependencies": {"ember-cli-babel": "^6.8.2", "ember-cli-htmlbars": "^2.0.3"}, "devDependencies": {... – RyanNerd Sep 06 '17 at 23:06