Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chasemccoy opened this issue Feb 12, 2023 · 2 comments
Open

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

chasemccoy opened this issue Feb 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@chasemccoy
Copy link

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/**',
  },
})
@tbroyer
Copy link

tbroyer commented Mar 7, 2023

My use-case is that I have some HTML files loaded in a "playground" component on some pages (using the playground-elements similar to https://lit.dev/playground), those HTML files aren't directly loaded (as HTML) by the browser but through a service worker, and their content is displayed in the playground editor; the injected reload-client script creates noise in the editor, and doesn't work in the preview pane as its origin is actually from unpkg.com.
I'd like to be able to ignore those files.

@zachleat zachleat added the enhancement New feature or request label Mar 13, 2023
@edwardhorsford
Copy link

I came here to request an equivalent to ignorePaths also.

My use case is somewhat similar to @chasemccoy - I have a local page I use for data capture, which I don't want to get auto-reloaded such that I lose that data. Without ignorePaths I'll have to be very careful when working on this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants