11ty / 11ty/dev-server

Request: Add option to not hot-reload certain file paths

Open
#53 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-votes
Dominant language
JavaScript
Stars
109
Forks
20
Avg merge
1m
Merged PRs (30d)
1

Description

Hello! I'm trying to upgrade my site to Eleventy 2.0.0 and the only feature I'm missing from the old BrowserSync server is the ability to not inject the snippet on certain pages.

I have a little in-browser editor for my blog and I run and use locally, and when I make edits in there it saves the changes back to the Markdown file on my filesystem. When this happens, it causes a page refresh, which blows away the state of my editor. I'd love to be able to tell Eleventy to not auto-reload that route specifically when a change is detected.

I was previously able to achieve this using this method in my Eleventy config:

config.setBrowserSyncConfig({
  snippetOptions: {
    ignorePaths: 'pathToIgnore/**',
  },
})

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the dev server's file-change handling and how it triggers page reloads or snippet injection. Compare the requested behavior with the shown BrowserSync snippetOptions.ignorePaths configuration. Done means a user can exclude a route or file path from automatic reload effects while other paths retain the current behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
devtools, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.