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

Add adapters for redirects middleware #16

Open
zachleat opened this issue Mar 14, 2022 · 1 comment · May be fixed by #57
Open

Add adapters for redirects middleware #16

zachleat opened this issue Mar 14, 2022 · 1 comment · May be fixed by #57
Labels
enhancement New feature or request

Comments

@zachleat
Copy link
Member

Personally I’d get a lot of use out of having netlify redirects available in dev mode as an adapter

https://github.com/netlify/netlify-redirect-parser

@zachleat zachleat added the enhancement New feature or request label Mar 14, 2022
@Snapstromegon
Copy link
Member

I ran across this while building a SPA with 11ty and in these cases netlify redirects not working is really annoying.

I also created a small reproduction of the issue here: https://github.com/Snapstromegon/netlify-eleventy-dev.

This is a small, but annoying bug (and I don't know if netlify dev not working too is on this, or netlify-cli's side to fix). There is a workaround for static builds though, when you use netlify dev:

Add these two scripts to your package.json:

{
    "build:watch": "npx @11ty/eleventy --watch",
    "dev": "npx netlify-cli dev"
}

Add this to your netlify.toml

[dev]
  framework = "#static"
  autoLaunch = false
  command = "npm run build:watch"

This does not work for stuff that requires the use of the dev server like auto reloading, but it solves the base issue as a workaround.

Btw: The redirect parser is now located here: https://github.com/netlify/build/tree/main/packages/redirect-parser

Snapstromegon added a commit to Snapstromegon/eleventy-dev-server that referenced this issue Mar 9, 2023
This is an incomplete implementation for Add adapters for redirects middleware 11ty#16

Signed-off-by: Raphael Höser <[email protected]>
@Snapstromegon Snapstromegon linked a pull request Mar 9, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants