Laravel Elixir - 将所有较少的文件编译/连接成一个css文件? [英] Laravel Elixir - Compile/concat all less files into one css file?

查看:152
本文介绍了Laravel Elixir - 将所有较少的文件编译/连接成一个css文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我在我的自定义/模块文件夹中使用了自定义较少的样式。他们都将被编译,但问题是它为每个较少的文件创建一个单独的css文件。我怎样才能得到一切,包括我的boostrap /供应商插件等先堆栈,然后将所有自定义css连接起来,全部移到main.css中? Elixir / Gulp有可能吗?我来自Grunt,有点困惑,因为没有很多关于Elixir的文档。

  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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆