mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	Add netlify for fast previews (#5353)
* Add netlify to readme * add redirect for testing * fix command * add SPA redirect * run desktop lighthouse tests * add base dir * remove base dir - use app redirect * remove unneeded redirect * remove status * remove status * static redirects * remove toml redirect * use toml again * make redirect conditional * add debug msg * remove check section
This commit is contained in:
		
							
								
								
									
										19
									
								
								src/frontend/netlify.toml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/frontend/netlify.toml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| # Netlify configuration file | ||||
| # https://www.netlify.com/docs/netlify-toml-reference/ | ||||
|  | ||||
| [build] | ||||
|   command = "yarn run build --outDir dist" | ||||
|   publish = "dist" | ||||
|  | ||||
| # Send requests to subpath | ||||
|  | ||||
| [[redirects]] | ||||
|   from = "/*" | ||||
|   to = "/index.html" | ||||
|   status = 200 | ||||
|  | ||||
| [[plugins]] | ||||
|   package = "@netlify/plugin-lighthouse" | ||||
|  | ||||
|   [plugins.inputs.settings] | ||||
|     preset = "desktop" # Optionally run Lighthouse using a desktop configuration | ||||
| @@ -8,3 +8,8 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||||
|     <App /> | ||||
|   </React.StrictMode> | ||||
| ); | ||||
|  | ||||
| // Redirect to /platform if on / | ||||
| if (window.location.pathname === '/') { | ||||
|   window.location.replace('/platform'); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user