Vite dev server still not working Change-Id: I45e64f0d1e41be19afe635addf94ea85f316c06f
diff --git a/ui/src/assets/index.html b/ui/src/assets/index.html index b818b81..8b9d0a2 100644 --- a/ui/src/assets/index.html +++ b/ui/src/assets/index.html
@@ -139,6 +139,8 @@ script.src = version + '/frontend_bundle.js'; script.onerror = () => errHandler(`Failed to load ${script.src}`); document.head.append(script); + + window.__GLOBAL_ASSET_ROOT__ = version + '/'; })(); </script> </body>
diff --git a/ui/src/assets/typefaces.scss b/ui/src/assets/typefaces.scss index d82fde1..d7f2610 100644 --- a/ui/src/assets/typefaces.scss +++ b/ui/src/assets/typefaces.scss
@@ -4,7 +4,7 @@ font-style: normal; font-weight: 100 900; font-display: swap; - src: url(assets/Roboto.woff2) format("woff2"); + src: url(./Roboto.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; @@ -17,7 +17,7 @@ font-display: swap; font-weight: 100 900; font-stretch: 50%; - src: url(assets/Roboto.woff2) format("woff2"); + src: url(./Roboto.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; @@ -29,7 +29,7 @@ font-style: normal; font-weight: 400; font-display: swap; - src: url(assets/RobotoMono-Regular.woff2) format("woff2"); + src: url(./RobotoMono-Regular.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; @@ -40,7 +40,7 @@ font-style: normal; font-weight: 100 700; font-display: block; - src: url(assets/MaterialSymbolsOutlined.woff2) format("woff2"); + src: url(./MaterialSymbolsOutlined.woff2) format("woff2"); } @mixin icon {
diff --git a/ui/src/base/http_utils.ts b/ui/src/base/http_utils.ts index 86b7d48..b7b3ab7 100644 --- a/ui/src/base/http_utils.ts +++ b/ui/src/base/http_utils.ts
@@ -72,6 +72,7 @@ * 'https://ui.perfetto.dev/v46.0-a2082649b/'. */ export function getServingRoot() { + return window.__GLOBAL_ASSET_ROOT__ || ''; // import.meta.url is the URL of *this* module file after bundling, which // sits next to frontend_bundle.js in the same /v1.2.3/ directory. Strip the // filename to get the serving root.