Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite build has wrong resource paths #113

Open
quazar-omega opened this issue Aug 7, 2023 · 0 comments
Open

Vite build has wrong resource paths #113

quazar-omega opened this issue Aug 7, 2023 · 0 comments

Comments

@quazar-omega
Copy link

quazar-omega commented Aug 7, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant