【问题标题】:Best way to include other CSS/JS libraries in a Github repo? [closed]在 Github 存储库中包含其他 CSS/JS 库的最佳方式? [关闭]
【发布时间】:2020-06-01 02:38:01
【问题描述】:

我想将FontAwesomeBulmajqueryjquery-ui 包含在我的前端部分的 Github 存储库之一中。目前我正在做的是在我自己的 JS/CSS 文件夹中使用这些项目中的 JS 文件或 CSS 文件,但我觉得有一种更简洁的方法可以做到这一点。我已经为此尝试了 git 子模块并且它们工作正常,尽管我不确定这是否是最好的方法。

【问题讨论】:

标签: javascript jquery css git github


【解决方案1】:

最好的方法是使用一些依赖管理系统,例如npmyarn

【讨论】:

    【解决方案2】:

    你可以使用包管理器,比如 yarn 、 npm 、 bower

    您可以在索引 html 文件中要求它们 检查这个 https://www.w3schools.com/jquery/jquery_get_started.asp 这一行

    <script src="jquery-3.4.1.min.js"></script>
    

    要求 jquery 为 $

    对于 jquery ui 检查这个 https://learn.jquery.com/jquery-ui/getting-started/

    <link rel="stylesheet" href="jquery-ui.min.css">
    <script src="external/jquery/jquery.js"></script>
    <script src="jquery-ui.min.js"></script>
    

    在文档中

    Font-Awesome
    https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself

    【讨论】:

      猜你喜欢
      • 2023-03-27
      • 2015-08-28
      • 2012-09-30
      • 1970-01-01
      • 1970-01-01
      • 2020-08-10
      相关资源
      最近更新 更多