Frontend / Backend seperation compile separate less
Hi Guys,
I'm struggling with a problem.
I'm in the process of moving an existing e-Commerce sure to a new Laravel 5 app.
They have entirely different front-end / backend templates, each with a bunch of .less files.
Could someone help me work out how to compile each .less file and store in a separate directory. ie.
'resources/assets/less/frontend.less' -> / public/css/style.css
'resources/assets/less/backend.less' -> / public/css/admin/style.css
I'm new to laravel and exilr.....
I've tried to separate mix's and it runs but does not do anything
Thanks in advance
elixir(function(mix) {
mix.less( 'less/frontend.less ' , 'css/style.css' , 'resources/assets/less/frontend.less' )
.less( 'less/backend.less' , 'css/admin/style.css' , 'resources/assets/less/backend.less' );
});
This is my lame attempt, no errors produced but no css compiled either
The third argument to mix.less() is the base directory that you want to use. You don't need it in this case, since you're using the default. Try:
elixir(function(mix) {
mix.less('less/frontend.less', './public/css/style.css')
.less('less/backend.less', './public/css/admin/style.css');
});
Does that do the trick for you?
I moved all less files to 'resources/less', then Jeffrey's code worked.
Much appreciated.
elixir(function(mix) {
mix.less( 'styles.less', './public/css/styles.css')
.less( 'admin/less/theme/theme_styles.less', './public/css/admin/theme_styles.css' );
});
Please or to participate in this conversation.