2 years ago

Laravel 5.4. How to automatically compile all .scss files in directory (recursively) into one css file.

Posted 2 years ago by gwyn0431

Hi everyone, i want to compile all of my .scss files in folder into one all.css file with immediate synchronization (and automatic recompile and all.css rebuild, if some of .scss files was changed). Laravel Mix does't provide any working solution. The best i can do, is to pass it and array of all my .scss files and merge them into one .css file, but then i have to do it manually (and yet i dunno how to configure synchronization.). Can anyone, please, provide me a good solution how to automatically compile all .scss files in the folder (recursively) into one all.css file, with immediate synchronization after any of .scss file in folder was overwritten. I was able to attain this with PHPStorm, using File Watchers. I have one watcher to automatically compile all .scss files into .css files using compass, and one using bash 'cat' command to combine all css files in one all.css. But, unfortunately, it takes me about 4 seconds from any changes in .scss file appears in all.css, and that's a bit too much. Thanks!

Please sign in or create an account to participate in this conversation.