Currently, I am expanding my knowledge of webpack and diving deeper into the world of JavaScript, including utilizing npm
.
Numerous responses discuss the comparison between --save
and --save-dev
when executing npm install
. From what I gather, their usage (along with updates to package.json
) proves beneficial in recreating a runtime or development environment using
npm install <the package being developed or ran>
--save
is employed to retain packages required for running the application in node.js, specifically on a server--save-dev
is used to store packages essential for app development- a simple
npm install <module>
installment only installs the package without allowing it to be installed elsewhere through an appropriate entry inpackage.json
Therefore, within a webpack framework, is --save
ever utilized? My belief is that it is not necessary, as a JS bundle is generated and subsequently included in the HTML file for execution in a browser. Thus, there is no need to "save modules required to run your app."
Similarly, --save-dev
is valuable (once again, within a webpack context) as it enables developers to work externally (in this scenario, both application modules (like moment.js
) and logistical ones (like gulp
) should be installed with --save-dev
, correct?)
Lastly, a basic npm install <module>
is feasible (though less practical) if the focus is solely on internal development (modules are installed but this action is not recorded in package.json
).
Is this assessment accurate? Particularly, is the assumption of the absence of --save
valid within a webpack setting?