package-json中的devDependencies与dependencies区别

#1.devDependencies

(1)内容:是一个对象,配置模块依赖的模块列表,key是模块名称,value是版本范围
(2)作用:该模块中所列举的插件属于开发环境的依赖(用于本地环境开发时候)
(3)部署来源:通过你npm install进行依赖安装时加上-save-dev

例:

npm install echarts -save-dev

#2.dependencies

(1)内容:是一个对象,配置模块依赖的模块列表,key是模块名称,value是版本范围
(2)作用:该模块中所列举的插件属于生产环境的依赖(程序正常运行需要加载的依赖)
(3)部署来源:通过你npm install进行依赖安装时加上-save

例:

npm install echarts -save

#参考格式:

"dependencies": {
    "axios": "^0.19.2",
    "echarts": "^4.8.0",
    "element-ui": "^2.13.2",
    "file-saver": "^2.0.2",
    "vue": "^2.6.11",
    "vue-context": "^5.1.0",
    "vue-router": "^3.2.0",
    "vuescroll": "^4.15.1",
    "vuex": "^3.4.0",
    "xlsx": "^0.15.6"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-loader": "^7.1.1",
    "babel-plugin-component": "^1.1.1",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-2": "^6.22.0",
    "chalk": "^2.0.1",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
  },

你可能感兴趣的:(vue,vue)