Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/ecommerce-jewellery-store/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script>
(() => {
const redirect = sessionStorage.redirect;
delete sessionStorage.redirect;
if (redirect && redirect !== location.href) {
history.replaceState(null, null, redirect);
}
})();
</script>
</body>

</html>
13 changes: 13 additions & 0 deletions examples/ecommerce-jewellery-store/public/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Page Not Found</title>
<script>
sessionStorage.redirect = location.href;
</script>
<meta http-equiv="refresh" content="0;URL='/'" />
</head>
<body></body>
</html>
9 changes: 8 additions & 1 deletion examples/ecommerce-jewellery-store/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
import { resolve } from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
Expand All @@ -16,6 +17,12 @@ export default defineConfig({
},
},
build: {
outDir: 'build'
outDir: 'build',
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
404: resolve(__dirname, "public/404.html"),
},
},
},
});
Loading