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 redirects to onPreDev #1633

Closed
sarahetter opened this issue Sep 22, 2022 · 3 comments
Closed

Add redirects to onPreDev #1633

sarahetter opened this issue Sep 22, 2022 · 3 comments
Assignees
Labels
priority: high type: bug code to address defects in shipped code

Comments

@sarahetter
Copy link

sarahetter commented Sep 22, 2022

When adding

[dev]
framework = "#static"

to the netlify.toml, ntl dev starts a static http server, serving files from the publish directory. This more closely mirrors what's happening with the app when it runs on Netlify.

However, right now ntl dev fails and only displays "Not Found" on the page, as we haven't generated and added redirects to the netlify.toml file, as we're doing when actually building. We need to add these redirects in the onPreDev step to allow ntl dev to function properly in this case.

This is also blocking #1553

@sarahetter sarahetter self-assigned this Sep 22, 2022
@sarahetter sarahetter added type: bug code to address defects in shipped code priority: high labels Sep 22, 2022
@ascorbic
Copy link
Contributor

We'd not want this in the plugin though, because real users won't be setting framework = #static and it would stop next dev from working. What we really need is a next serve command, which would allow us to serve the site in an equivalent way to when deployed.

@orinokai
Copy link
Contributor

I thought that was the purpose of netlify dev, to serve the site in an equivalent way to when deployed?

@sarahetter
Copy link
Author

Closing as this isn't the way forward :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

3 participants