File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
examples/ecommerce-jewellery-store Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1717< body >
1818 < div id ="root "> </ div >
1919 < script type ="module " src ="/src/main.tsx "> </ script >
20+ < script >
21+ ( ( ) => {
22+ const redirect = sessionStorage . redirect ;
23+ delete sessionStorage . redirect ;
24+ if ( redirect && redirect !== location . href ) {
25+ history . replaceState ( null , null , redirect ) ;
26+ }
27+ } ) ( ) ;
28+ </ script >
2029</ body >
2130
2231</ html >
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="utf-8 " />
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1 " />
6+ < title > Page Not Found</ title >
7+ < script >
8+ sessionStorage . redirect = location . href ;
9+ </ script >
10+ < meta http-equiv ="refresh " content ="0;URL='/' " />
11+ </ head >
12+ < body > </ body >
13+ </ html >
Original file line number Diff line number Diff line change 11import { defineConfig } from 'vite' ;
22import react from '@vitejs/plugin-react' ;
33import path from 'path' ;
4+ import { resolve } from 'path' ;
45import { fileURLToPath } from 'url' ;
56
67const __filename = fileURLToPath ( import . meta. url ) ;
@@ -16,6 +17,12 @@ export default defineConfig({
1617 } ,
1718 } ,
1819 build : {
19- outDir : 'build'
20+ outDir : 'build' ,
21+ rollupOptions : {
22+ input : {
23+ main : resolve ( __dirname , "index.html" ) ,
24+ 404 : resolve ( __dirname , "public/404.html" ) ,
25+ } ,
26+ } ,
2027 } ,
2128} ) ;
You can’t perform that action at this time.
0 commit comments