示例:
{
"name": "scrm",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.19.2",
"cnpm": "^7.1.1",
"core-js": "^3.8.3",
"register-service-worker": "^1.7.2",
"vue": "^3.2.13",
"vue-router": "^4.0.3"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-pwa": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-vue": "^8.0.3",
"less": "^4.0.0",
"less-loader": "^8.0.0",
"prettier": "^2.4.1"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"parser": "@babel/eslint-parser"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead",
"not ie 11"
]
}
说明
名称 | 说明 | 示例 |
---|---|---|
name | 包名称 | vue-demo |
version | 包的版本号 | 0.1.0 |
description | 包的描述 | 这是一个demo |
main | 包入口文件 | index.js |
files | 上传npm的白名单,即被允许上传的文件 | [“src”,”demo”,”index.js”] |
private | 定义私有模块。一般公司的非开源项目,都会设置 private 属性的值为 true,这是因为 npm 拒绝发布私有模块,通过设置该字段可以防止私有模块被无意间发布出去。 | |
scripts | 指定了运行脚本命令的npm命令行缩写 | “serve”: “vue-cli-service serve” |
repository | 远程代码仓库 | {“type”: “git”, “url”: “https://github.com/earen/vue-demo” } |
keywords | 关键字。它是一个字符串数组。这有助于人们发现您的包裹,因为它在 中列出npm search。 | [“javascript”,”vue”] |
author | 作者 | earen |
license | 包遵循的协议,默认是ISC也就是开放源代码的协议 | ISC |
bugs | 问题追踪 | “url”: “https://github.com/earen/vue-demo/issues”,”email” :”project@hostname.com” |
homepage | 包的主页 | https://github.com/earen/vue-demo#readme |
engines | 运行引擎,指明node.js运行所需要的版本 | “node”: “>= 6.0.0″,”npm”: “>= 3.0.0” |
devDependencies | 开发环境的依赖所需要的第三方模块(包)列表 | “less”: “^4.0.0″,”less-loader”: “^8.0.0” |
dependencies | 生产环境的依赖所需要的第三方模块(包)列表 | |
peerDependencies | 对等依赖列表 |
原创文章,作者:254126420,如若转载,请注明出处:https://blog.ytso.com/245662.html