Angular 2 instant CSS reload

705 views Asked by At

I'm looking very hard to find a solution to this. I'm trying to serve my application so it reloads only changed css files without recompilling the whole app, because now it's very frustrating when you change one thing in CSS and have to wait for the app to recompile. I tried to use lite server but with no luck. Quick Start app works just fine, but I cant configure my CLI projects the same way. Any help?

Thanks!

1

There are 1 answers

0
Nikhil Maheshwari On

Learn a little about grunt / gulp, I think that can help you here.

You need to call livereload.changed(files) when change happens. To do that see gulp-watch doc. (stackoverflow)

watch('**/*.css', function (files) {
  livereload.changed(files)
});

https://css-tricks.com/gulp-for-beginners/