liveBook · Manning

Development dependency

As explained in Pro Angular 16

The devDependencies property is an npm manifest field listing packages required during development but excluded from the finished application.

A development dependency is a package listed in package.json for building, testing, serving, or otherwise developing an application, rather than for the finished application itself. NPM installs these packages with the project’s dependency tree in node_modules. section 9.2.2

Use development dependencies to separate development tooling from runtime requirements:

  • Keep application runtime packages in dependencies and development-only packages in devDependencies. section 9.2.2
  • Install a package into devDependencies with npm install package@version --save-dev. section 9.2.2
  • Expect Angular tooling, compilers, type definitions, test runners, and browser launchers in devDependencies. section 9.2.2

Angular development tooling

An Angular project can list @angular/cli, @angular-devkit/build-angular, @angular/compiler-cli, TypeScript, Jasmine, Karma, and related launchers under devDependencies. Scripts then expose commands such as start, build, watch, and test for development workflows. section 9.2.2

...
"devDependencies": {
  "@angular-devkit/build-angular": "^16.0.0",
  "@angular/cli": "~16.0.0",
  "@angular/compiler-cli": "^16.0.0",
  "@types/jasmine": "~4.3.0",
  "jasmine-core": "~4.6.0",
  "karma": "~6.4.0",
  "karma-chrome-launcher": "~3.2.0",
  "karma-coverage": "~2.2.0",
  "karma-jasmine": "~5.1.0",
  "karma-jasmine-html-reporter": "~2.0.0",
  "typescript": "~5.0.2"
}
...

Inspect a representative devDependencies listing containing Angular build tools, compiler support, TypeScript, and testing packages. section 9.2.2

Deployment configuration

A deployment-specific package manifest can place production HTTP/HTTPS server tools in devDependencies when the application has already been incorporated into prerendered files. Its start script launches the production server. section 8.6.2

How Pro Angular 16 covers it

How deep it goes
Defines the manifest distinction, shows representative packages, and demonstrates installation with npm, but does not detail dependency-resolution internals.
Examples
Uses Angular CLI, TypeScript, Jasmine, Karma, and deployment server packages as concrete devDependencies.
What it assumes
Assumes familiarity with package.json and NPM while distinguishing dependencies from devDependencies.
What you can do after
Operate NPM to install development-only packages and identify tooling that belongs in devDependencies.
How it connects
Connects package.json with NPM, dependencies, node_modules, build tools, scripts, and unit testing.

Also explained in

Compare how 4 books explain development dependency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Pro Angular 16. The section links point to the parts of the book it draws on.