Thursday, March 2, 2017

Laravel 5.4 reference to Mix CSS file

I'm trying to set up a SASS to CSS compiler via Mix (previously Elixer) in Laravel 5.4 (using https://laravel.com/docs/5.4/mix). Everything is working fine, it compiles and I can set up a watcher via npm, but referencing it via the views/layout/app.blade.php file, like:

 <link rel="stylesheet" href="">

doesn't work. In my browser, it is shown of course as:

<link rel="stylesheet" href="/css/app.css">

It is the wrong path. It should be referencing to http://localhost/website/public/css/app.css, but changing anything in the Mix code above, generates a Laravel error.

Unable to locate Mix file: /website/public/css/app.css. 
Please check your webpack.mix.js output paths and try again.

What am I doing wrong? Do I need to set a base path somewhere, is my .htaccess wrong, or..? Thank you for any answers.



via Ewinnn

Advertisement