Laravel Elixir - 将所有较少的文件编译/连接成一个css文件? [英] Laravel Elixir - Compile/concat all less files into one css file?
本文介绍了Laravel Elixir - 将所有较少的文件编译/连接成一个css文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
elixir(function ){
mix.less([
plugins / bootstrap.less,
custom / module * .less
],'public / assets / css');
});
解决方案
您必须使用mix.styles来连接CSS文件合并为一个。
首先运行你的少,然后像这样:
mix.styles(['css / one.css','css / two.css'],null,'public / assets / css');
So I have my custom less styles in my custom/module folder. They will all be compiled but the problem is it's creating an individual css file for each of the less files. How can I get EVERYTHING, including the my boostrap/vendor plugins etc to stack first, and all my custom css to be concatenated after, all moved to main.css? Is this possible with Elixir/Gulp? I am coming from Grunt and am a bit confused as there is not a lot of documentation on Elixir.
elixir(function(mix) {
mix.less([
"plugins/bootstrap.less",
"custom/module*.less"
], 'public/assets/css');
});
解决方案
You have to use mix.styles to concatenate the CSS files into one.
First run your less, and then something like:
mix.styles(['css/one.css', 'css/two.css'], null, 'public/assets/css');
这篇关于Laravel Elixir - 将所有较少的文件编译/连接成一个css文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文