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

Remove prerender.createIndexFiles option in favour of adapter control #3799

Closed
Rich-Harris opened this issue Feb 9, 2022 · 0 comments · Fixed by #3801
Closed

Remove prerender.createIndexFiles option in favour of adapter control #3799

Rich-Harris opened this issue Feb 9, 2022 · 0 comments · Fixed by #3801

Comments

@Rich-Harris
Copy link
Member

Describe the problem

In #2632 we added the prerender.createIndexFiles option, and I'm pretty sure it was a mistake. On most platforms you shouldn't be touching it at all. The only time the user should be configuring it is when they're targeting a static file host (i.e. they're using adapter-static) and the index files are problematic for some reason (e.g. they cause the host to redirect /foo to /foo/, breaking relative URLs).

There may be situations where an adapter needs to set this option, with knowledge of how it will interact with the platform (e.g. Netlify's default is to map about.html to /about and about/index.html to /about/ — I think we're probably getting this wrong at the moment).

Describe the proposed solution

Remove prerender.createIndexFiles in favour of making it part of the adapter API...

const prerendered = await builder.prerender({
  all: false,
  dest,
  index: false
});

...and exposing it via the adapter-static options.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

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

Successfully merging a pull request may close this issue.

1 participant