Issue with Redirects and Jekyll

answered
#1

To be clear, this may not be an issue. This may not be a CLI issue. This may just be me being dense. :wink:

When first testing netlify dev, I noticed I had not set up redirects correctly for my site. I began testing and noticed that my changes were not being reflected unless I completely restarted the CLI.

I read the docs on telling Jekyll to include underscore files and adding this to my config:

include: [_redirects]

This worked in that my generated _site directory got the copy, but didn’t address the problem while running netlify dev. I noticed that changes to /_redirects did not copy to _site/_redirects until after I told Jekyll to generate a new build.

My site takes near ten minutes to build so for now I’m simply copying the file by hand while it runs, but I just wanted to share this in case it is a real bug, or I’m missing something obvious.

#2

Hiya, as per our docs on netlify dev, your _redirects file needs to live in the projects publish folder.

Does this help?

#3

FYI, I replied earlier but the site never “saved” the response. :frowning:

No… well maybe and I don’t get it. :wink: So I added _redirects to my site route. I told Jekyll to include it. If I run a jekyll build , it copies it.

But when using netlify dev , changes to the file do NOT get noticed and copied.

Does that make sense?

#4

cc @perry i think our docs may be slightly misleading on this. netlify dev does not copy the _redirects file for you, because thats something your build tool does and we run your devserver, not your build tool, during netlify dev. so we actually have to point people to the static folder in the [dev] block in netlify.toml where _redirects is contained.