我在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
文件中,该文件将自动编译
- 将该 CSS 导入
希望您正在使用
angular-cli
软件包
@import '~bootstrap/dist/css/bootstrap.min.css';