Skip to content

Support NextJS SPAs#537

Open
dmeijboom wants to merge 1 commit intorailwayapp:mainfrom
brainpodnl:feat/support-nextjs-spas
Open

Support NextJS SPAs#537
dmeijboom wants to merge 1 commit intorailwayapp:mainfrom
brainpodnl:feat/support-nextjs-spas

Conversation

@dmeijboom
Copy link
Copy Markdown

This PR adds support for NextJS SPAs (when using output: "export" to export static HTML). It supports the default output directory as well as a custom output directory (similar to Astro).

Changes

  • Add convenience method ReadFirstFileOf(..) to read the first existing file from a slice of filenames
  • Refactor existing code to use ReadFirstFileOf(..) (where applicable)
  • Add next.go for NextJS SPA related code which closely mirrors astro.go

Testing

Added a new test to verify next SPAs and tested manually with an existing project, both with output as "export" (SPA) as well as "standalone" (not SPA).

@iloveitaly
Copy link
Copy Markdown
Collaborator

@dmeijboom thanks for this! At a first glance, this look great. Will take a look next week and get it merged.

@dmeijboom dmeijboom force-pushed the feat/support-nextjs-spas branch from 73ee308 to 5e25cc7 Compare April 2, 2026 09:59
@dmeijboom
Copy link
Copy Markdown
Author

@dmeijboom thanks for this! At a first glance, this look great. Will take a look next week and get it merged.

Nice! Appreciate it. Updated the PR to fix failing linting/tests.

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 this pull request may close these issues.

2 participants