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

vite plugin for Static Site Generation (SSG) #22

Open
2 tasks done
cliffordfajardo opened this issue Dec 30, 2022 · 0 comments
Open
2 tasks done

vite plugin for Static Site Generation (SSG) #22

cliffordfajardo opened this issue Dec 30, 2022 · 0 comments
Labels

Comments

@cliffordfajardo
Copy link
Collaborator

cliffordfajardo commented Dec 30, 2022

Description

As a developer moving from Nextjs that is used to static site generation, it would be nice to be able to use SSG in my remix app

Suggested solution

Create a vite plugin that can do SSG for you when you run npm run build

Background context
One of the questions i hear alot about remix is that if can do static site generation.
For folks wanting to use remix to build marketing sites, homepage's or even blog's, this could be a useful.
Useful for environments that where you can't or are not allowed to easily provision your own server and only have access to pushing static files to server/CDN

Alternative

Manual Approach

The alternative is setting this up manually by writing your own script
For example. create script that will:

  • start your remix app
  • then have your crawler in your script, visit a list of urls in your app (AKA your static pages) get the HTML output
    • save the HTML output from visiting the page to a public or static directory
  • ...

More details on a basic implementation for conceptual purposes

Vite plugin approach

  • users wouldn't need to write a manual script
  • plugin can tap into vite SSR apis and build lifecycle
  • user's can pass options object to vite plugin

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@jrestall jrestall added enhancement New feature or request contribution welcome labels Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants