The difference between--save and--save-dev?
--save-dev
It is the module that depends on the development time, --save
is the module that relies on after release.
--save will add the dependency package name to the Package.json file dependencies,
--save-dev is added to the Package.json file devdependencies.
For example: "NPM install--save-dev gulp-uglify", which is not available after release, but only used in development. So use--save-dev for installation. Like the jquery library or the angular framework, the post-development-line environment still relies on them, so it needs to be installed using--save.
What you need to add is:
When using NPM install, the modules in dependencies and devdependencies are downloaded,
If you use NPM install--production or the NODE_ENV variable value is production, only the modules in dependencies will be downloaded.
Front End Knowledge Fragment notes