From bd6b4112b0559629561211aa8c9970a72e13b791 Mon Sep 17 00:00:00 2001 From: Sychev Andrey <44414066+SychevAndrey@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:43:23 +0400 Subject: [PATCH] fix: serve assets relatively with Vite (#3318) --- webapp/packages/product-default/vite.config.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/packages/product-default/vite.config.ts b/webapp/packages/product-default/vite.config.ts index 007a226893..7abf0f5b75 100644 --- a/webapp/packages/product-default/vite.config.ts +++ b/webapp/packages/product-default/vite.config.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2024 DBeaver Corp and others + * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -14,6 +14,10 @@ import packageJson from './package.json'; export default defineConfig( ({ mode }): UserConfig => ({ + /* + Fixes https://github.com/dbeaver/cloudbeaver/issues/3308 + ROOT_URI approach for assets doesn't work well when we serve our application not from a root folder. In that case inner Vite asset handling system add indices to CSS files using absolute path ignoring injected ROOT_URI. When using relative path in base property, we ask Vite to generate paths relatively to each file https://vite.dev/guide/build#public-base-path. */ + base: './', plugins: [baseConfigurationPlugin(mode, packageJson)], }), );