Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel elixir compile multiple less files

I have this two files in resources/assets/less folder style.less and admin/style.less. I want to compile this files to diffrent paths as the following:

style.less compiled to public/css/

and the other one compiled to public/admin/styles/

this is What i did in the gulpfile.js

elixir(function(mix) {
    mix.less('style.less', 'public/css/');
    mix.less('admin/style.less', 'public/admin/styles/');
});

but this compile only one file. What is the problem and how can i fix this issue?

like image 878
Mohamed Nagy Avatar asked Mar 29 '15 14:03

Mohamed Nagy


1 Answers

I have a project that compiles two different less files to two different css files. The only difference that I see is that I specify the full destination path including the file name.

So, for your case, it will be:

elixir(function(mix) {
    mix.less('style.less', 'public/css/style.css')
       .less('admin/style.less', 'public/admin/styles/style.css');
});
like image 154
Idob Avatar answered Oct 09 '22 18:10

Idob