Skip to content

Instantly share code, notes, and snippets.

View kacha930's full-sized avatar

robin.dev kacha930

  • nairobi
  • 02:55 (UTC +03:00)
View GitHub Profile
@kacha930
kacha930 / FrontendFrameworksPopularity.md
Created July 29, 2024 09:18 — forked from tkrotoff/FrontendFrameworksPopularity.md
Front-end frameworks popularity (React, Vue, Angular and Svelte)
@kacha930
kacha930 / VSCode-live-server-setup.md
Created July 13, 2024 17:46 — forked from ihollander/VSCode-live-server-setup.md
Setup instructions for Live Server in VSCode (how to prevent issues working with json-server)

Problem Statement

Live Server is a great tool for working with Javscript. It automatically reloads our code any time changes are made to files in the folder where Live Server is running. This becomes an issue when using a tool like json-server with a .json file in the same directory - since changes you make using POST/PATCH/DELETE requests will update the .json file, these changes will also cause your app to reload.

Solution

You can solve this by telling Live Server to ignore changes to certain files. Open your VSCode preferences by pressing command + shift + p in VSCode and searching for "Preferences: Open Settings (JSON)". Then, add the following lines to the settings.json file:

"liveServer.settings.ignoreFiles": [