Why does Ember install everything as devDependencies and not normal dependency

Ember CLI applications have package.json, which lists everything as a dev dependency. Even the material that is needed in the application version. For example, packages such as ember and ember-data are installed as devdependencies.

As a reference, here is an example of what I'm saying: https://github.com/ember-cli/ember-new-output/blob/master/package.json#L17-L38

What is the reason for this?

+6
source share
1 answer

In the context of the application:

As pointed out by @Lux comments, they are not needed after the build.

The output of the application is build , which should be the final product. In addition, you are usually independent of another application. Usually you are dependent on a package or addon.

In the context of addons:

I think there is an opinion to display all the dependencies of the application addons in the package.json application file. Thus, you can prevent the addition of an addon that is not interesting to add a js file to the assembly.

As a result, an explicit way to manage dependencies is to leave all your dependencies on your devDependencies and add all the addon dependencies to the package.json application with default drawings. Therefore, the end user can configure them.

+5
source

Source: https://habr.com/ru/post/1014875/


All Articles