我将 bootstrap-sass-official
添加到我的 bower 依赖项到 bower_components
中。
我以这种方式(在 gulpfile.js
中)编译并添加了 bootstrap css 文件到 public
:
var paths = {
'bootstrap': 'bower_components/bootstrap-sass-official/assets/',
'jquery': 'bower_components/jquery/dist/'
};
elixir(function(mix) {
mix.sass('app.scss', null, {includePaths: [paths.bootstrap + 'stylesheets/']});
});
在 app.scss
中有一行 @import '_bootstrap';
。并且 css 文件被编译并且它们可以工作。
如何向页面添加 Bootstrap 字体和脚本?
最佳答案
我找到了一个解决方案:
mix.scripts(
'*',
'resources/assets/javascripts',
'public/js/app.js'
);
mix.scripts(
[
paths.jquery + 'jquery.js',
paths.bootstrap + 'javascripts/bootstrap.js'
],
'public/js/dependencies.js',
'bower_components'
);
mix.copy(paths.bootstrap + 'fonts/bootstrap/', "public/fonts/");
关于twitter-bootstrap - 如何使用 bower、gulp 和 elixir 在 Laravel 5 中安装 Bootstrap ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27757200/