https://docs.npmjs.com/files/package.json
里面有介绍到 dep 的 file 字段。
文档里面找到更详细的介绍如下:
https://docs.npmjs.com/files/package.json#local-paths
Local Paths
s of version 2.0.0 you can provide a path to a local directory that contains a package. Local paths can be saved using npm install -S or npm install --save, using any of these forms:
../foo/bar
~/foo/bar
./foo/bar
/foo/bar
in which case they will be normalized to a relative path and added to yourpackage.json. For example:
{
"name": "baz",
"dependencies": {
"bar": "file:../foo/bar"
}
}
This feature is helpful for local offline development and creating tests that require npm installing where you don't want to hit an external server, but should not be used when publishing packages to the public registry.
最后
以上就是无聊发带最近收集整理的关于package.json 的详细原版说明之 本地路径库引用的全部内容,更多相关package.json内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复