Posted in web development
2436
11:43 pm, January 13, 2022
 

add a live reloading server with one npm command

I work on a lot of html sites, and usually i go into the editor make a change, go back into the browser and hit reload or clear cache and reload, repeat process.

I saw all of these NPM's and other things like that that have live reload, i tried a script that also does this but it didnt seem to work well.

Then i googled it again and found this article that describes how to install live-server from npm, and its really that easy if you have node and npm installed. Why have i been manually reloading all this time!!

Install live-server

sudo npm i -g live-server

once this is installed just open a terminal at your location you want to live reload.

and run the command

live-server

then this will open a browser with all the files in that location, just click a html file in there and its auto live reloading, make a change and its there!

View Statistics
This Week
81
This Month
214
This Year
253

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Items in web development
Search Articles
Search Articles by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
I believe that in order to better your knowledge base, it takes a lot of failing in order to succeed. I don't consider anything a failure as long as you get back up and you learn from your own mistakes.
Unknown
Random CSS Property

linear-gradient()

The linear-gradient() CSS function creates an image consisting of a progressive transition between two or more colors along a straight line. Its result is an object of the <gradient> data type, which is a special kind of <image>.
linear-gradient() css reference