Laravel-mix: Refreshing styles with "npm run hot" and sass

Created on 30 Jan 2017  路  3Comments  路  Source: JeffreyWay/laravel-mix

Greetings!

I have an issue with refreshing styles in hot-mode, I don't see any errors, build was successfully compiled, I saw some movements in "Dev Console" and that's it... after that I don't see any changes on the webpage... Anyway, everything fine with Vue refreshing...

webpack.mix.js
mix.sass('resources/assets/sass/app.scss', 'public/css');

index.blade.php
<link rel="stylesheet" href="{{ mix('css/app.css') }}">

I'm doing something wrong?
Thanks

Most helpful comment

I think we're going to implement Browsersync to fix this.

All 3 comments

Hot reloading sass isn't supported, see https://github.com/JeffreyWay/laravel-mix/issues/92#issuecomment-273558018. It's only for javascript modules.

Maybe this should be more explicitly noted in the docs @JeffreyWay

I think we're going to implement Browsersync to fix this.

Browsersync isn't really working properly with Vue.js and reloading whole page instead of component.

There is a solution to include app.scss file from the main app.js:

import '../sass/app.scss'

and remove from webpack.mix.js:

.sass('resources/assets/sass/app.scss', 'public/css')

Everything with like a charm in this case.

For production it however will require to configure ExtractTextPlugin.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kpilard picture kpilard  路  3Comments

tillkruss picture tillkruss  路  3Comments

jpmurray picture jpmurray  路  3Comments

terion-name picture terion-name  路  3Comments

Micaso picture Micaso  路  3Comments