简体   繁体   English

为什么开源库的代码文件在 github repo 和 node_modules 中不同

[英]Why code files of an open source library are different in github repo and node_modules

I installed lodash module and wanted to look at their code and I noticed that the file structure and the code in my node_modules are different from what is in their github repo.我安装了 lodash 模块并想查看他们的代码,我注意到我的 node_modules 中的文件结构和代码与他们的 github 存储库中的不同。 I mean if I install the library and also clone their repo the code will be different.我的意思是,如果我安装库并克隆他们的 repo,代码将会不同。 Can someone explain to me why they are different?有人可以向我解释为什么他们不同吗? Is it because of build process that changes the file structure?是因为构建过程改变了文件结构吗? If yes, is there a way I can take the code from repo and create the “bundled” version?如果是,有没有办法从回购中获取代码并创建“捆绑”版本?

I'm asking these questions because for example in “lodash” repo there is no “build” command but still the code in node_modules is different than their code in repo.我问这些问题是因为例如在“lodash”repo 中没有“build”命令,但 node_modules 中的代码仍然不同于它们在 repo 中的代码。

Thanks.谢谢。

The very first thing the README tells you: README告诉你的第一件事:

Generated using lodash-cli :使用lodash-cli生成:

 $ npm run build $ lodash -o./dist/lodash.js $ lodash core -o./dist/lodash.core.js

… is that the build tool is in a different package. ...是构建工具在不同的 package 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM