Skip to content

Vite build has wrong resource paths #113

@quazar-omega

Description

@quazar-omega

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions