I figured out a workaround. It's not elegant and so kind of annoying, but it's working. I'm "touching" the files before Mix starts. So the files are present and Mix is only filling them. In this case the combination works properly.
const mix = require('laravel-mix');
const del = require('del');
const fs = require('fs');
// === Styles ===
// Touching CSS files so they exists in the filesystem before mix starts. Otherwise the combined CSS file would stay empty.
fs.writeFile('public/css/scss.css', '', function (err) { if (err) throw err; });
fs.writeFile('public/css/stylus.css', '', function (err) { if (err) throw err; });
mix.sass('resources/sass/bootstrap.scss', '/css/scss.css')
.stylus('resources/stylus/app.styl', '/css/stylus.css')
.combine([
'public/css/scss.css',
'public/css/stylus.css',
], 'public/css/all.css')
.then(() => {
del('public/css/scss.css');
del('public/css/stylus.css');
}
);
Maybe there will be a build in solution for temporary files in the future. :)