将React-native组件发布到npm后,有哪些步骤? 我试图在NPM中发布样本组件。 我们以前需要建立吗? 如果有,怎么样? 任何人都可以详细说明这些命令吗?
答案 0 :(得分:0)
不,你不需要构建,只需将android本机代码放在android和ios目录中,将root.in中的index.js重新放置,然后
在 package.json
中这样 {
"_from": "package-name@0.1.3",
"_id": "package-name@0.1.3",
"_inBundle": false,
"_location": "/package-name",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "package-name@0.1.3",
"name": "package-name",
"escapedName": "package-name",
"rawSpec": "0.1.3",
"saveSpec": null,
"fetchSpec": "0.1.3"
},
"_requiredBy": [
"/"
],
"_spec": "0.1.3",
"author": {
"name": "Your name",
"email": "your@gmail.com"
},
"bugs": {
"url": "https://github.com/bug/issues"
},
"dependencies": {
"prop-types": "^15.6.0"
},
"description": "description about pacakge",
"homepage": "https://github.com/#readme",
"keywords": [
"react-native",
"react",
"dnd"
],
"license": "MIT",
"main": "index.js",
"name": "package-name",
"peerDependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/package-name.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.1.3"
}