mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-19 12:00:39 +08:00
Build tweaks (#529)
* build tweaks * update build output location for frontend
This commit is contained in:
parent
5fdd721834
commit
7ac497ad34
6
.gitignore
vendored
6
.gitignore
vendored
@ -13,6 +13,7 @@ build/
|
||||
# JS build
|
||||
gradio/templates/frontend/static
|
||||
gradio/templates/frontend/build
|
||||
gradio/templates/frontend/assets
|
||||
gradio/templates/frontend/global.css
|
||||
|
||||
# Secrets
|
||||
@ -40,4 +41,7 @@ demo/files/*.mp4
|
||||
.DS_Store
|
||||
*.bak
|
||||
workspace.code-workspace
|
||||
*.h5
|
||||
*.h5
|
||||
|
||||
# log files
|
||||
.pnpm-debug.log
|
File diff suppressed because one or more lines are too long
@ -1,46 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" style="height: 100%; margin: 0; padding: 0;">
|
||||
<html lang="en" style="min-height: 100%; margin: 0; padding: 0">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel='stylesheet' href='/build/bundle.css'>
|
||||
<link rel='stylesheet' href='/build/themes.css'>
|
||||
|
||||
<link rel="stylesheet" href="./global.css">
|
||||
|
||||
<title>{{ config['title'] or 'Gradio' }}</title>
|
||||
<meta property="og:url" content="https://gradio.app/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image" content="{{ config['thumbnail'] or '' }}" />
|
||||
<meta property="og:title" content="{{ config['title'] or '' }}" />
|
||||
<meta property="og:description" content="{{ config['description'] or '' }}" />
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:creator" content="@teamGradio">
|
||||
<meta name="twitter:title" content="{{ config['title'] or '' }}">
|
||||
<meta name="twitter:description" content="{{ config['description'] or '' }}">
|
||||
<meta name="twitter:image" content="{{ config['thumbnail'] or '' }}">
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-156449732-1"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-156449732-1');
|
||||
window.gradio_mode = "app";
|
||||
</script>
|
||||
<script>
|
||||
window.gradio_config = {{ config|tojson }};
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
|
||||
<title>Gradio</title>
|
||||
</head>
|
||||
|
||||
<body style="height: 100%; margin: 0; padding: 0;">
|
||||
<div id="root" style="height: 100%"></div>
|
||||
|
||||
</body>
|
||||
<script defer src='/build/bundle.js'></script>
|
||||
|
||||
<title>{{ config['title'] or 'Gradio' }}</title>
|
||||
<meta property="og:url" content="https://gradio.app/" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image" content="{{ config['thumbnail'] or '' }}" />
|
||||
<meta property="og:title" content="{{ config['title'] or '' }}" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="{{ config['description'] or '' }}"
|
||||
/>
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:creator" content="@teamGradio" />
|
||||
<meta name="twitter:title" content="{{ config['title'] or '' }}" />
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="{{ config['description'] or '' }}"
|
||||
/>
|
||||
<meta name="twitter:image" content="{{ config['thumbnail'] or '' }}" />
|
||||
<script
|
||||
async
|
||||
src="https://www.googletagmanager.com/gtag/js?id=UA-156449732-1"
|
||||
></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag("js", new Date());
|
||||
gtag("config", "UA-156449732-1");
|
||||
window.gradio_mode = "app";
|
||||
</script>
|
||||
<script>
|
||||
window.gradio_config = {{ config|tojson }};
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
|
||||
<title>Gradio</title>
|
||||
<script type="module" crossorigin src="/assets/index.f0e5ef9f.js"></script>
|
||||
<link rel="modulepreload" href="/assets/vendor.b2926c28.js">
|
||||
<link rel="stylesheet" href="/assets/vendor.169535ab.css">
|
||||
<link rel="stylesheet" href="/assets/index.c16552b7.css">
|
||||
</head>
|
||||
|
||||
<body style="height: 100%; margin: 0; padding: 0">
|
||||
<div id="root" style="height: 100%"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
3
ui/.gitignore
vendored
3
ui/.gitignore
vendored
@ -1,5 +1,4 @@
|
||||
node_modules
|
||||
public/build/
|
||||
|
||||
.DS_Store
|
||||
.pnpm-debug.log
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import Interface from "./Interface.svelte";
|
||||
// import "./global.css";
|
||||
import "./global.css";
|
||||
|
||||
export let title;
|
||||
export let description;
|
||||
|
@ -11,6 +11,9 @@ export default defineConfig(({ mode }) => {
|
||||
const production = mode === "production";
|
||||
|
||||
return {
|
||||
build: {
|
||||
outDir: "../../../gradio/templates/frontend"
|
||||
},
|
||||
define: {
|
||||
BUILD_MODE: production ? JSON.stringify("prod") : JSON.stringify("dev"),
|
||||
BACKEND_URL: production
|
||||
|
Loading…
x
Reference in New Issue
Block a user