Vite build has wrong resource paths
quazar-omega opened this issue · 0 comments
quazar-omega commented
Tested on the ts template.
In the build environment all the resource paths were prepended by with a trailing '/'
so none of my resources were being loaded, after removing those leading slashes manually the resources loaded correctly, to fix I modified the base
option in the config to be either 'dist'
or ''
(empty string), then it works as well.
Example vite.config.ts
:
import { defineConfig } from 'vite';
import basicSsl from '@vitejs/plugin-basic-ssl'
import solidPlugin from 'vite-plugin-solid';
export default defineConfig({
plugins: [
solidPlugin(),
basicSsl()
],
server: {
port: 5000,
https: true,
host: true
},
build: {
target: 'esnext',
},
base: ''
});
Is this issue affecting my setup only or should I provide a PR?