2.0.4 • Published 6 months ago

github-pages-plugin-for-type-route v2.0.4

Weekly downloads
119
License
MIT
Repository
github
Last release
6 months ago

What?

This is a build tool to enable Vite and create-react-app's sites that uses type-route to be deployed on gh-pages.

The Problem it solves

Github pages has no configuration to enable single pages application. If you GET https://my-domain.com/a/b/foo github page will serve a/b/foo.html when in reality we would like that, regardless of the url path, it's always the index.html that is served.
The workaround is to copy the content of index.html into a 404.html file, it works but it's very bad for SEO.

The solution

Copying the index.html everywhere there is a path before deploying.

How to set it up

image

image

image

WARNING: In the router.ts file you can only perform relative import, import using based on the baseUrl option of the tsconfig.json file are not supported.

Then when we run yarn build and this will get generated for us:

image

All this files are copies of index.html generated by the tool:

[
    "auteur.html",
    "evenements.html",
    "naturalisme.html",
    "naturalisme/antilles.html",
    "naturalisme/france.html",
    "naturalisme/ouset-canadiens.html",
    "naturalisme/reunion.html",
    "portrait.html",
    "404.html"
]

result: No more 404 🥳

image

This is a project that uses this module: https://github.com/thieryw/theo-tz
It's online here: http://thieryw.github.io/theo-tz

1.0.1

6 months ago

1.0.0

6 months ago

2.0.2

6 months ago

2.0.4

6 months ago

2.0.1

6 months ago

2.0.0

6 months ago

0.1.1

9 months ago

0.1.0

2 years ago

0.0.9

2 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago