wl-tree2
v1.0.1
Published
- package.json 可以通过 npm init -y 生成 - tsconfig.json 可以通过 tsc --init 生成
Readme
组件发布
装包
- package.json 可以通过 npm init -y 生成
- tsconfig.json 可以通过 tsc --init 生成
npm install vite -D # vite 构建工具
npm install @vitejs/plugin-react-swc -D # 插件编译React
npm install vite-plugin-dts -D #生成d.ts文件 声明文件
npm install react #react依赖
npm install react-dom #react依赖
npm install @types/react -D # 类型
npm install @types/react-dom -D # 类型
npm install @types/node -D # 类型打包后修改 package.json
name:包名(npm 上的名字) version:版本 files:要上传到 npm 的文件(这里边 dist 上传到 npm) main:cjs 入口 module:esm 入口 types:类型文件
{
"name": "wl-tree",
"version": "1.0.0",
"description": "",
"main": "dist/wlumd.js",
"module": "dist/wl.es.js",
"types": "dist/wl.es.d",
"files": ["dist"],
"scripts": {
"dev": "vite",
"build": "vite build"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@types/node": "^24.1.0",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"@vitejs/plugin-react-swc": "^3.11.0",
"vite": "^7.0.6",
"vite-plugin-dts": "^4.5.4"
}
}发布
npm login # 登录账号
npm publish --access public使用
npm install xxx