laravel-sass
laravel-sass copied to clipboard
[better instalation instructions] I have found a better way to install laravel-sass
after te composer step, instead of messing with public/index.php which is a very bad idea, it's better to make a service provider named SassServiceProvider (I am not sure if service provider were meant to do this, but this works) and there:
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use SassCompiler;
class SassServiceProvider extends ServiceProvider
{
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
if(config('app.debug') == true){
SassCompiler::run("../resources/sass/", "css/");
}
}
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}
}
also remember to register the service provider in config/app.php
with this, you are sure you will only do stuff when you are not in development, and you are not messing with laravel's core.
the only bad thing about this solution is that SassCompiler::run() first argument needs to have the ../resources/ at the beginning which is not so bad after all.
It seems to run, but I get a blank app.css file.
At the end I found out that is better use laravel-mix, you can find out how to use it in https://www.youtube.com/watch?v=UzegdHgNEF4
pd. que mamada que hablemos en ingles
Hi, yes this repo is really really old (i started this around 2012 i think), please have a look at Laravel Mix or other scss compilers for other frameworks ()they also work without a framework), it'S worth it :)