当前位置:网站首页>The difference between -s and -d when downloading packages using NPM

The difference between -s and -d when downloading packages using NPM

2022-07-07 23:59:00 Xiao Zhang, run quickly.

npm install name -save-dve Abbreviation (npm install name -D) Automatically add the module and version number to devdependencies.

npm install name -save Abbreviation (npm install name -S) Automatically add the module and version number to dependencies.

-D after , The installation package will package Medium devDependencies In the object . abbreviation dev.dev It is used in the development environment .

give an example :

Building tools :gulp and webpack It is used to compress code , Tools needed for packaging , When the program actually runs, it doesn't need , It's going to be put in dev So use -D

-S after , The installation package will package Medium dependencies In the object . abbreviation dep.dep It is used in the production environment .

give an example :

Project plug-in : for example element uiecharts This plug-in To be used in operation , It's going to be put in dep So I use -S

Generally, our project plug-ins , stay api You can see , It's usually -S. Because these plug-ins are used during program operation .

原网站

版权声明
本文为[Xiao Zhang, run quickly.]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130553106187.html