当前位置:网站首页>npm---package.json
npm---package.json
2022-04-21 13:39:00 【monstkl】
作用:包管理配置文件,兼项目配置文件
// 在目录中快速生成package.json
npm init -y
一、必须属性相关配置项
// 1、name
// 如果需要发布在 npm 上,name 字段一定要符合要求。
"name": "yp",
// 2、version
// 格式为:「主版本号. 次版本号. 修订号」。
// 修改主版本号是做了大的功能性的改动
// 修改次版本号是新增了新功能
// 修改修订号就是修复了一些bug
"version": "1.1.0",
二、描述信息相关配置项
// description、keywords是用来增加项目包的曝光率
// author contributors 作者和贡献者
// homepage 项目的主页地址
// repository 代码的存放仓库地址
三、依赖相关配置项
// dependencies 生产环境依赖
// devDependencies 开发环境依赖
"dependencies": {
"react": "17.0.2",// 固定版本
"react-dom": "~17.0.2",// 不低于17.0.2版本,但是不改变主版本号和次版本号
"react-scripts": "^4.0.3",// 不低于4.0.3版本,但是不改变主版本号
"jquery": "latest",// 安装最新版本
"@aurora/card": "1.0.3" // @aurora/card是个范围包,aurora是范围名称,aurora范围下的card包
}
四、脚本相关配置项
// scripts 是 package.json 中内置的脚本入口
// 可以通过 npm run 来执行命令
// 可以结合 pre 和 post 完成前置和后续操作
"scripts": {
"dev": "node index.js",
"predev": "node beforeIndex.js",
"postdev": "node afterIndex.js"
}
// config 字段用来配置 scripts 运行时的配置参数
五、文件&目录相关配置项
main、browser、module、bin、files、man、directories
六、发布相关配置项
// license 软件的开源协议
// publishConfig
// private、preferGlobal
七、第三方相关配置项
// 1、typings 指定 TypeScript 的入口文件
// 2、eslintConfig eslint的配置
// eslint的配置可以写在单独的配置文件.eslintrc.json 中
// 3、babel 指定 Babel 的编译配置
// 4、browserslist 用来告知支持哪些浏览器及版本
// 5、lint-staged 和 gitHooks 一起配置,每次提交代码只会检查当前改动的文件
版权声明
本文为[monstkl]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43390711/article/details/124308946
边栏推荐
- 网易数帆王佰平:我的 Envoy Maintainer 之路
- Do self media and short videos. You don't have to shoot videos yourself. Dazhou teaches you a quick way to start
- Upgrade the jdbc driver to version 8.0.28 and connect the pit record of MySQL
- Can great talents be of little use? Oceanbase integration scenario test
- SECOND: Sparsely Embedded Convolutional Detection
- Flink相关API开发及运行架构和实现原理详解
- Which brand of running headphones is good and suitable for sports
- Work function of boost ASIO
- Establishment of binary tree and its cueing
- 做自媒体、短视频,不用自己拍视频,大周教你一个快速起号的方法
猜你喜欢

Exercise questions and answers of quality, investment and progress control in 2022 supervision engineer examination

程序员爆出自己的薪资税前月薪15000

Idea automatically generates unit test classes

STM32 drives st7789v2 TFT screen

Stm32cupemx installation

Peking University ACM problems 1009: edge detection

【数字信号处理】线性常系数差分方程 ( 使用 matlab 求解 “ 线性常系数差分方程 “ 示例 | A 向量分析 | B 向量分析 | 输入序列分析 | matlab 代码 )

How to uninstall openjdk and install Oracle JDK under CentOS

How to recover if U disk data is lost? U disk data recovery, two schemes completed

Xcode Cloud 入门:拉取请求 (PR) 工作流程
随机推荐
通讯录的动态实现
Peking University ACM problems 1011: sticks
【數字信號處理】相關系數 ( 相關系數概念解析 | 信號能量常數 | 共軛序列 | 序列在相同時刻的相關性 )
After the completion of hundreds of millions of yuan of financing, smart bank plans to land urban intelligent driving products in more than 100 cities
Wechat hidden function series: wechat regular reminder, 2 steps, to relax yourself when you are busy
Industry video super resolution new benchmark, Kwai & Dalian research, boarded CVPR 2022
An example of expert system and its skeleton system
How to install the database of Dameng 8 version in Kirin V10 SP2
SQLyog导入sql文件
Tailwind core concept - responsive design
Suggestion: Alt + X marks the marked area. Can I cancel the marking?
[digital signal processing] linear constant coefficient difference equation (determine whether the system is a "linear time invariant system" according to "linear constant coefficient difference equat
Review questions and answers of architectural physics and equipment for class I registered architect examination in 2022
Hcip road OSPF expansion configuration
Wang Baiping: my way to envoy maintainer
leetcode:513. Find the value in the lower left corner of the tree [simply BFS find the first one in each layer]
北京大学ACM Problems 1009:Edge Detection
完成数亿元融资后,毫末智行计划超百城落地城市智能驾驶产品
Servlet中关于web.xml的测试
CV technical guide free knowledge planet