Skip to content

Instantly share code, notes, and snippets.

@ihollander
Last active June 17, 2025 18:41
Show Gist options
  • Save ihollander/cc5f36c6447d15dea6a16f68d82aacf7 to your computer and use it in GitHub Desktop.
Save ihollander/cc5f36c6447d15dea6a16f68d82aacf7 to your computer and use it in GitHub Desktop.

Revisions

  1. ihollander revised this gist Oct 22, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion VSCode-live-server-setup.md
    Original 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.
  2. ihollander created this gist Oct 22, 2020.
    14 changes: 14 additions & 0 deletions VSCode-live-server-setup.md
    Original 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"
    ],
    ```