[英]Replicating libman unpkg with a local filesystem
I noticed I can use libman to download many libraries into my Asp.Net Core app in a nice way.我注意到我可以使用 libman 以一种很好的方式将许多库下载到我的 Asp.Net Core 应用程序中。 Eg I can easily get the latest @microsoft signalr:
例如,我可以轻松获得最新的@microsoft signalr:
However, in my application I can't rely on external package sources and would like to store the packages I need within my network.但是,在我的应用程序中,我不能依赖外部 package 源,而是希望将我需要的包存储在我的网络中。 I noticed that libman supports "filesystem" mode, so I copied all the files downloaded from unpkg onto my local network drive, let's call it "L:"
我注意到libman支持“文件系统”模式,所以我将所有从unpkg下载的文件复制到我的本地网络驱动器上,我们称之为“L:”
/ L:
| local_unpkg
| @microsoft
| signalr
| 5.0.2
| package.json
| README.md
| src
| ... // a lot of files
| dist
| browser
| cjs
| esm
| ... // other subfolders
When I try using "filesystem" provider, I get only the files in directly in the folder I specify, without nested folders:当我尝试使用“文件系统”提供程序时,我只直接在我指定的文件夹中获取文件,没有嵌套文件夹:
Is there a way to import entire packages that way, without manually specifying all the subfolders in the libman.json file?有没有办法以这种方式导入整个包,而无需手动指定 libman.json 文件中的所有子文件夹?
If not, what's the recommended approach for using the tool in an environment, when I don't want to rely on external package sources?如果不是,当我不想依赖外部 package 源时,在环境中使用该工具的推荐方法是什么?
The filesystem provider specifically does not support recursive directory contents.文件系统提供程序特别不支持递归目录内容。 With the other providers, the contents of the package are available all at once via the catalog metadata.
对于其他提供程序,package 的内容可通过目录元数据一次性获得。 But with file paths, and especially network file paths, iterating the file system can lead to extremely poor performance in large (or deep) directory structures.
但是对于文件路径,尤其是网络文件路径,迭代文件系统会导致大型(或深度)目录结构的性能极差。 In many cases, you'd be typing out the path and the wizard would try to evaluate the contents as you type (eg once you typed
L:\
it would recognize that directory and enumerate all its contents recursively, over the network).在许多情况下,您会输入路径,向导会在您输入时尝试评估内容(例如,一旦您输入
L:\
,它就会识别该目录并通过网络递归枚举其所有内容)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.