Last active
June 17, 2025 18:41
-
-
Save ihollander/cc5f36c6447d15dea6a16f68d82aacf7 to your computer and use it in GitHub Desktop.
Revisions
-
ihollander revised this gist
Oct 22, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,6 @@ You can solve this by telling Live Server to ignore changes to certain files. Op ".vscode/**", "**/db.json" ], ``` This will tell Live Server to ignore changes to any `db.json` files. You can add other files to this as well if you wish. -
ihollander created this gist
Oct 22, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ ## Problem Statement [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) 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: ```json "liveServer.settings.ignoreFiles": [ ".vscode/**", "**/db.json" ], ```