Dependencies vs. devDependencies in package.json — what’s the difference?

In package.json, regular dependencies are packages that are required for your production-ready site or app to work. Production-ready means the online version of your website or app that the audience experiences.

devDependencies are packages used for development purposes, e.g for running tests or transpiling your code.

"devDependencies": {
    "babel-eslint": "^10.0.1",
    "cli-glob": "^0.1.0",
    "eslint": "^6.0.1",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-prettier": "6.0.0",
    "stylelint": "^10.1.0",
    "stylelint-config-standard": "^18.0.0",
    "write-good": "^1.0.1"
},

Many packages that you install during development of a product are not required for your app to work in production (online) — so we add those to our package.json devDependencies object, like in the example above.


Has this been helpful to you?

You can support my work by sharing this article with others, or perhaps buy me a cup of coffee 😊

Kofi