mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +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:
parent
339eae53a1
commit
39464f645a
@ -9,6 +9,7 @@
|
||||
[![Documentation Status](https://readthedocs.org/projects/inventree/badge/?version=latest)](https://inventree.readthedocs.io/en/latest/?badge=latest)
|
||||
![Docker Build](https://github.com/inventree/inventree/actions/workflows/docker.yaml/badge.svg)
|
||||
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7179/badge)](https://bestpractices.coreinfrastructure.org/projects/7179)
|
||||
[![Netlify Status](https://api.netlify.com/api/v1/badges/9bbb2101-0a4d-41e7-ad56-b63fb6053094/deploy-status)](https://app.netlify.com/sites/inventree/deploys)
|
||||
|
||||
[![Coveralls](https://img.shields.io/coveralls/github/inventree/InvenTree)](https://coveralls.io/github/inventree/InvenTree)
|
||||
[![Crowdin](https://badges.crowdin.net/inventree/localized.svg)](https://crowdin.com/project/inventree)
|
||||
@ -156,8 +157,10 @@ Find a full list of used third-party libraries in [our documentation](https://do
|
||||
<a href="https://inventree.org/digitalocean">
|
||||
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
|
||||
</a>
|
||||
<a href="https://www.netlify.com"> <img src="https://www.netlify.com/v3/img/components/netlify-color-bg.svg" alt="Deploys by Netlify" /> </a>
|
||||
</p>
|
||||
|
||||
|
||||
<!-- License -->
|
||||
## :warning: License
|
||||
|
||||
|
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');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user