Dev dependencies in npm in JavaScript
There are also libraries that are needed only in the development process as a tool for the programmer's work. Examples of such libraries are Webpack or Gulp tools (we will study them in the future).
Such libraries are also installed via npm. However, they should not be installed into normal dependencies, but into special dependencies for a developer.
To do this, you need to call the
installation with the --save-dev
flag:
terminalnpm install --save-dev webpack
Or in shorter form:
terminalnpm install -D webpack
Or even shorter:
terminalnpm i -D webpack
As a result, packages installed by such
a command will fall into the
devDependencies setting:
package.json{
"devDependencies": {
"webpack": "^5.74.0"
}
}
Задание 1
Install the Gulp library:
terminalnpm install --save-dev gulp
Examine a package.json file.