Add 404.html for static hosting (#8276)

Adds a `404.html` to allow client-side routing to work when using static hosting.

# Important Notes
- The routing uses the existing logic to infer the base path. This means that if the user accesses an invalid path, the invalid path will be used as the base path.
This commit is contained in:
somebody1234 2023-11-13 19:09:01 +10:00 committed by GitHub
parent 94aa58e2a5
commit 6cf75daea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 5 deletions

View File

@ -39,11 +39,6 @@
<link rel="stylesheet" href="./ensoFont.css" />
<script type="module" src="./index.js" defer></script>
<script type="module" src="./run.js" defer></script>
<script
src="https://cdn.jsdelivr.net/npm/@twemoji/api@14.1.2/dist/twemoji.min.js"
integrity="sha384-D6GSzpW7fMH86ilu73eB95ipkfeXcMPoOGVst/L04yqSSe+RTUY0jXcuEIZk0wrT"
crossorigin="anonymous"
></script>
</head>
<body>
<div id="root"></div>

View File

@ -32,6 +32,7 @@ async function bundle() {
})
opts.entryPoints.push(
path.resolve(THIS_PATH, 'src', 'index.html'),
path.resolve(THIS_PATH, 'src', '404.html'),
path.resolve(THIS_PATH, 'src', 'index.ts')
)
opts.metafile = ANALYZE

View File

@ -0,0 +1 @@
index.html