Skip to content

Include the original index.html from the app build for route fallback #361

@spencerb02

Description

@spencerb02

🧩 Feature request

Description

A clear and concise description of the problem or missing capability...

We would like the original index.html from the outputPath of the cli build added the outDir of the Scully build. Then, if a route doesn't have a statically generated /some/path/index.html then I can route to this source index.html and they will get the old experience of just waiting for the app to load. (It would also be great if the Scully server worked this way.)

Without it, my users would get the default index.html which contains the result of / instead of /some/path until the app loaded at which time they'd get the content they expect.

Since the result of / is already called [outDir]/index.html we would need to name it something different like index.src.html or src-index.html.

Describe the solution you'd like

If you have a solution in mind, please describe it.

Include the index.html from the cli build renamed as src-index.html (or similar name...) in the Scully outDir.

Route to this version of the index.html as the default when a route finds no results in the dev server.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

Alternatively, we can do this ourselves by grabbing the index.html from the outputPath of the cli build and copying it to the deployment directory when we grab the contents of the Scully outDir on deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions