shouldn"t vue use vue-router? Why can it only be put into devDependencies (development dependency)?
shouldn"t vue use vue-router? Why can it only be put into devDependencies (development dependency)?
vue-router uses npm install-- save
url-loader uses npm install-- save-dev
url-loader is a tool for developing products, and vue-router is the material for products, just like you are a carpenter, url-loader is a wrench, and vue-router is a wood material used to build wardrobes, so people like url-loader should use-- save-dev
if someone plans to download and use your module in their program, they may not want or need to download and build the external test or documentation framework you use.in this case, it is best to map these add-ons to devDependencies objects.
translated from: https://docs.npmjs.com/files/.
if your module does not need to be published to npm for others to install, it will be the same anywhere.
shouldn't vue-router be used in vue?
vue never stipulates that vue-router
must be used, just like vuex
, but vue-router
is used for page jump convenience (especially SPA),), and vue-router
is optional when vue-cli
initializes.
as to why I put it in devDependencies
, it means that I put it all into dependencies
in my development, otherwise it won't affect me after build?
Previous: Does JS judge multiple clicks on the same button?
Next: How to use the token front end in the RESTful interface?