yarn publish和之间有区别吗npm publish?我已经编写了一个包,但由于某种原因,当我使用发布新版本时,yarn publish我无法在其他项目中导入该包。这很令人困惑,因为发布会导致npm publish工作导入。
{
"name": "@catpic/console-highlighter",
"version": "0.1.6",
"license": "MIT",
"description": "Highlight console log messages with style.",
"repository": {
"type": "git",
"url": "https://github.com/dlaub3/highlighter.git"
},
"directories": {
"lib": "./lib"
},
"prepublish": "tsc -b",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"start": "parcel --out-dir serve index.html",
"build": "tsc -b"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.11.0",
"@typescript-eslint/parser": "^4.11.0",
"eslint": "^7.16.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.0",
"jest": "^26.6.3",
"parcel-bundler": "^1.6.1",
"prettier": "^2.2.1",
"typescript": "^4.1.3"
},
"keywords": [
"typescript",
"javascript"
]
}
Run Code Online (Sandbox Code Playgroud)
最后,我需要添加该files字段,以便yarn包含 lib 文件夹的完整内容。
"files": [
"lib/**/*"
],
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6081 次 |
| 最近记录: |