【问题标题】:Uploading React app on Github Pages: how to skip the uploading of the node modules folder?在 Github Pages 上上传 React 应用程序:如何跳过节点模块文件夹的上传?
【发布时间】:2019-01-05 06:32:50
【问题描述】:

我一直在尝试在我的 Github 页面上上传一个普通的 React 应用程序,但每次上传具有所有这些依赖项的节点模块文件夹都需要很长时间。我尝试仅上传构建文件夹(缩小版),但它不起作用,可能是因为带有指向我的 Github 文件夹的字符串的 package.json 文件位于非缩小文件夹中。 有没有办法跳过 node_modules 文件夹的上传? 另外,能否请您指出一个关于如何在 Github 上正确上传 React 应用程序的好教程?

【问题讨论】:

  • 与 gitignore?

标签: java html reactjs github npm


【解决方案1】:

创建一个 .gitignore 文件并将 node_modules 放在那里。

下面是 .gitignore 到 react-gh-pages 的示例:.gitignore

【讨论】:

    猜你喜欢
    • 2017-04-04
    • 2019-12-28
    • 2019-11-23
    • 2018-04-26
    • 1970-01-01
    • 2021-12-04
    • 2017-09-14
    • 2011-12-12
    • 2022-01-12
    相关资源
    最近更新 更多