I purchased Metronic.
The DEV (yarn dev) version runs without problems. I'm trying to build and run a test DIST (yarn build) version on the server. But I get a blank screen at the address of the public server. I have one file in the dist folder (/metronic/metronic-v9.1.2/metronic-tailwind-react/typescript/vite/dist) "index.html " and 2 folders "assets" and "media".
At the same time, inside the file index.html I have links to "/metronic/tailwind/react/media/app" and "/metronic/tailwind/react/assets" that are not physically present.
What did I do wrong?
Hi ÐонÑÑанÑин ÐÑогаÑкий
Sorry for the delay in responase. Since you're deploying the app to a subfolder (like /metronic/tailwind/react/), Vite needs to know about that during the build. By default, Vite assumes the app will be hosted at the root (/), so all links in index.html are generated that way.
To fix this, you should update the base option in your vite.config.ts file:
// vite.config.ts
import { defineConfig } from "vite"
export default defineConfig({
base: "/metronic/tailwind/react/", // your subfolder path here
// other config...
})