http://localhost:4200/node_modules/bootstrap/dist/css/bootst



我在index.html文件中添加了引导依赖项。 此索引文件位于 src 文件夹中。 节点模块在它上面。文件夹结构如下。

Library
  node_modules
  src
    index.html

现在我的目标是从索引.html node_modules。我的代码如下。

   <link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.min.css">
   <script src="../node_modules/jquery/dist/jquery.min.js"></script>

并且还尝试了./,只是从node_modules开始。这里有什么问题。

  • 请检查该文件是否在 node_modules
    • 将该 CSS 导入styles.css文件中,该文件将自动编译

希望您正在使用angular-cli软件包

@import '~bootstrap/dist/css/bootstrap.min.css';

相关内容

最新更新