在上面的目录中找不到bower_components
Unable to find bower_components in the directory above
我的一个项目中有以下目录结构:
/web
/bower_components
/bootstrap
/jquery
/typeahead.js
/views
/index.jade
我正试图以以下方式使用index.jade
文件中的这些组件:
link(src='../bower_components/bootstrap/dist/css/bootstrap.min.css', rel='stylesheet')
script(src='../bower_components/jquery/dist/jquery.min.js')
script(src='../bower_components/typeahead.js/dist/typeahead.bundle.min.js')
但它不起作用(这个页面上没有与bootstrap
相关的样式,jQuery代码也不起作用)。
为什么?我做错了什么?我该怎么修?
我应该用不同的方式来指代这些组件吗?
我应该将bower_components
目录放在另一个文件夹中吗?
您可能需要将文件路径更改为相对于编译jade文件的位置。
例如,如果你把玉石渲染成这样:
/web
/index.html
源路径将是
link(src='bower_components/bootstrap/dist/css/bootstrap.min.css', rel='stylesheet')
script(src='bower_components/jquery/dist/jquery.min.js')
script(src='bower_components/typeahead.js/dist/typeahead.bundle.min.js')
相关文章:
- React:为什么不;t React.addons.cloneWithProps与Components配合使用
- VueJS components
- 仅选择带有gull和'主bower文件'
- Bower安装EACCESS错误
- 为什么wiredep一直在移除我的bower组件
- 如何在网页中包含bower组件
- Gulp bower图像路径
- Gulp找到我的Bower组件并将其插入
- 对Node,NPM,Bower以及将其用于Bootstrap感到困惑
- 可以在 Travis 发起的构建上运行 bower & npm
- 与 bower 一起安装的 ACE 编辑器找不到我的模式
- npm,bower,gulp,Yeoman和grunt有什么好处
- requirejs+bower,bower组件中的路径和依赖关系
- 使用bower-install时使用webcomponents.js
- 如何让我的ember.js应用程序导入从bower或npm安装的模块
- gulp-main-bower文件正则表达式过滤器不起作用
- 如何合并bower依赖项
- 将bower配置为只安装dist文件夹
- 可以't使用grunt-bower任务插件运行我的grunt-task
- Bower Components未在Rails中引用