vite build always using static paths

This leading path is the base URL, configured by the base option, which is / by default.

You can remove the base URL by setting base to an empty string, making the path relative to its deployment directory:

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  base: '', 👈
})

demo

Leave a Comment