<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: elJeffe</title>
    <description>The latest articles on DEV Community by elJeffe (@eljeffe).</description>
    <link>https://dev.to/eljeffe</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F541190%2Faea267c4-8bf4-4e46-a083-71510f098e11.png</url>
      <title>DEV Community: elJeffe</title>
      <link>https://dev.to/eljeffe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eljeffe"/>
    <language>en</language>
    <item>
      <title>NPM dependencies vs dev dependencies, how to decide?</title>
      <dc:creator>elJeffe</dc:creator>
      <pubDate>Sun, 06 Feb 2022 20:52:34 +0000</pubDate>
      <link>https://dev.to/eljeffe/npm-dependencies-vs-dev-dependencies-how-to-decide-38bb</link>
      <guid>https://dev.to/eljeffe/npm-dependencies-vs-dev-dependencies-how-to-decide-38bb</guid>
      <description>&lt;p&gt;After searching for a while I cannot seem to find a solid answer on npm dependencies vs dev dependencies. The opinions vary widely when it comes to this question. &lt;/p&gt;

&lt;p&gt;In general I found the following answers, which all make sense to a certain degree:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dependencies are what you absolutely need in a production build (e.g. axios, redux), other packages are dev dependencies (e.g. types, testing, typescript).&lt;/li&gt;
&lt;li&gt;Dependencies are what you need to run the project locally in a development environment (i.e. typescript would be needed), only types and testing are dev dependencies. &lt;/li&gt;
&lt;li&gt;Just follow the command on npmjs.com (if it uses --save-dev its a dev dependency)&lt;/li&gt;
&lt;li&gt;Just put everything as a dependency as the build will only use what it needs&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now I'm wondering what the exact 'rules' are regarding this differences in layman's terms. For example, answer 1 could give errors with &lt;code&gt;npm ci&lt;/code&gt;, while option 4 could theoretically increase the overall production size. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;React Typescript package.json example&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"dependencies": {
  "@testing-library/jest-dom": "^5.16.2",
  "@testing-library/react": "^12.1.2",
  "@testing-library/user-event": "^13.5.0",
  "@types/jest": "^27.4.0",
  "@types/node": "^16.11.22",
  "@types/react": "^17.0.39",
  "@types/react-dom": "^17.0.11",
  "react": "^17.0.2",
  "react-dom": "^17.0.2",
  "react-scripts": "5.0.0",
  "typescript": "^4.5.5",  
  "web-vitals": "^2.1.4"
},
"devDependencies": {}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>npm</category>
      <category>beginners</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
