问题描述
我想在 npm 中使用 @organization-scope/package/sub-package
.
I want to use @organization-scope/package/sub-package
in npm.
我的package.json如下:-
My package.json is as follows:-
{
"name": "@once/ui",
...
...
}
如果我这样做:-
{
"name": "@once/ui/select-box",
...
...
}
它给我一个错误,说无效名称.
我正在使用 angular 5.有人可以帮我实现同样的目标吗?
I am using angular 5. Can someone help me do achieve the same?
推荐答案
NPM 中没有嵌套作用域这样的东西.
There is no such thing as a nested scope in NPM.
尝试导入 @once/ui/select-box
会在 @once 的根目录中为您提供一个名为
包 - 您可以利用此行为来获得接近您想要实现的目标,但发布名称中包含多个斜杠的包是不可能的.select-box.js
的文件/ui
Trying to import @once/ui/select-box
would give you a file called select-box.js
from within the root of the @once/ui
package - you can utilize this behaviour to get something close to what you're trying to achieve, but publishing a package with multiple slashes in the name is not possible.
这篇关于在嵌套范围内发布包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!