fix: serve assets relatively with Vite (#3318)

This commit is contained in:
Sychev Andrey
2025-03-18 09:43:23 +01:00
committed by GitHub
parent 34f4063114
commit bd6b4112b0
@@ -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)],
}),
);