gpt4 book ai didi

php - Laravel Elixir includePaths 不起作用

转载 作者:行者123 更新时间:2023-12-01 15:34:57 26 4
gpt4 key购买 nike

我正在尝试使用 Laravel Elixir 并希望使用 includePaths 包含 Bootstrap ,但它不起作用。我哪里错了?

var paths = {
'bootstrap': './vendor/bower_components/bootstrap-sass-official/assets/'
}

elixir(function(mix) {
mix.sass("style.scss", 'public/assets/css/', {includePaths: [paths.bootstrap + 'stylesheets/']})
});

最佳答案

我不确定您是否有理由要在您的 gulpfile 中执行 includePaths,但对于 Bootstrap ,您不必这样做。 Bootstrap 包含路径已经在/node_modules/laravel-elixir/ingredients 中开箱即用地配置:

elixir.extend('sass', function(src, output, options) {

options = _.extend({
outputStyle: inProduction ? 'compressed' : 'nested',
includePaths: [elixir.config.bowerDir + "/bootstrap-sass-official/assets/stylesheets"]
}, options);

return compile({
compiler: 'Sass',
pluginName: 'sass',
pluginOptions: options,
src: src,
output: output,
search: '**/*.+(sass|scss)'
});
});

所以你所要做的就是在你的 gulpfile 中:

elixir(function(mix) {
mix.sass("style.scss");
});

然后在你的 style.scss 中:

@import "bootstrap";

我认为您必须将 .bowerrc 文件设置为:

{
"directory": "vendor/bower_components"
}

但看起来您已经这样做了。

关于php - Laravel Elixir includePaths 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28441951/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com