mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +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 @@
|
|||||||
[](https://inventree.readthedocs.io/en/latest/?badge=latest)
|
[](https://inventree.readthedocs.io/en/latest/?badge=latest)
|
||||||

|

|
||||||
[](https://bestpractices.coreinfrastructure.org/projects/7179)
|
[](https://bestpractices.coreinfrastructure.org/projects/7179)
|
||||||
|
[](https://app.netlify.com/sites/inventree/deploys)
|
||||||
|
|
||||||
[](https://coveralls.io/github/inventree/InvenTree)
|
[](https://coveralls.io/github/inventree/InvenTree)
|
||||||
[](https://crowdin.com/project/inventree)
|
[](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">
|
<a href="https://inventree.org/digitalocean">
|
||||||
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
|
<img src="https://opensource.nyc3.cdn.digitaloceanspaces.com/attribution/assets/SVG/DO_Logo_horizontal_blue.svg" width="201px">
|
||||||
</a>
|
</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>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
<!-- License -->
|
<!-- License -->
|
||||||
## :warning: 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 />
|
<App />
|
||||||
</React.StrictMode>
|
</React.StrictMode>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Redirect to /platform if on /
|
||||||
|
if (window.location.pathname === '/') {
|
||||||
|
window.location.replace('/platform');
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user