question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compiling and combining multiple less/css files

See original GitHub issue

In Laravel Exlixir I used to use the following to compile and combine multiple LESS & CSS files together into one file.

var styles = [
    './resources/assets/vendor/bootstrap/less/bootstrap.less',
    './resources/assets/vendor/datatables/css/dataTables.bootstrap.css',
    './resources/assets/vendor/material-icons/css/material-design-iconic-font.min.css',
    './resources/assets/vendor/custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css',
    './resources/assets/vendor/bootstrap-select/css/bootstrap-select.css',
    './resources/assets/vendor/datepicker/build/css/bootstrap-datetimepicker.min.css',
    './resources/assets/vendor/chosen/chosen.css',
    './resources/assets/app/less/app.less'
];

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

But this is not possible in Laravel Mix

var styles = [
    './resources/assets/vendor/bootstrap/less/bootstrap.less',
    './resources/assets/vendor/datatables/css/dataTables.bootstrap.css',
    './resources/assets/vendor/material-icons/css/material-design-iconic-font.min.css',
    './resources/assets/vendor/custom-scrollbar-plugin/jquery.mCustomScrollbar.min.css',
    './resources/assets/vendor/bootstrap-select/css/bootstrap-select.css',
    './resources/assets/vendor/datepicker/build/css/bootstrap-datetimepicker.min.css',
    './resources/assets/vendor/chosen/chosen.css',
    './
];

mix.less(styles, 'public/css/app.css');

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

5reactions
JeffreyWaycommented, Feb 19, 2017

With Mix, you should either import all of those files from your main .less entry-point, or instead use mix.combine() after.

mix.less('resources/assets/less/app.less', 'public/css/app.css')
    .combine([
        'other/files.css',
        'public/css/app.less'
    ], 'public/css/everything.css');
2reactions
MladenJanjetoviccommented, Apr 22, 2017

@JeffreyWay In your example I guess you meant public/css/app.css in .combine()

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compiling and combining multiple less/css files #416 - GitHub
In Laravel Exlixir I used to use the following to compile and combine multiple LESS & CSS files together into one file. var...
Read more >
Combining two .less files in one - css - Stack Overflow
So, something similar as compiling to .css , but keeping the .less structure. Is it possible to do via a command line tool,...
Read more >
Command Line Usage - Less CSS
Compile .less files to .css using the command line. Heads up! ... we recommend pre-compiling using Node.js or one of the many third...
Read more >
Compile LESS CSS Files with the LESS App - David Walsh Blog
Enter LESS.app: a Mac app which allows you to add folders containing .less files and automatically compiles them when a file is saved!...
Read more >
Combining multiple Less files - Laracasts
What's the proper way to combine multiple Less files into one? The following doesn't work... mix.less([ 'resources/assets/less/theme/core.less', ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found