-->

Laravel Elixir - Compile/concat all less files int

2019-09-04 19:23发布

问题:

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');
});

回答1:

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');