fix(vite): use base path

This commit is contained in:
Elian Doran 2025-05-19 19:51:33 +03:00
parent 6286c39381
commit e536ec4cbf
No known key found for this signature in database
3 changed files with 4 additions and 3 deletions

View File

@ -2,12 +2,14 @@
import { join } from 'path';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy'
import asset_path from './src/asset_path';
const assets = [ "assets", "stylesheets", "libraries", "fonts", "translations" ];
export default defineConfig(() => ({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/client',
base: "/" + asset_path,
server: {
port: 4200,
host: 'localhost',

View File

@ -1,4 +1,3 @@
import assetPath from "./asset_path.js";
import { isDev } from "./utils.js";
export default isDev ? assetPath + "/src" : assetPath + "/app-dist";
export default assetPath + "/src";

View File

@ -1,6 +1,6 @@
import packageJson from "../../package.json" with { type: "json" };
import { isDev } from "./utils";
const assetPath = isDev ? `http://localhost:4200` : `assets/v${packageJson.version}`;
const assetPath = isDev ? `http://localhost:4200/assets/v${packageJson.version}` : `assets/v${packageJson.version}`;
export default assetPath;