Skip to content

CLI ignores Vite server config #2165

@dreitzner

Description

@dreitzner

Describe the bug

packages\kit\src\cli.js => async function get_Config() does not load the vite part of the config.

Therefore the params for server (like host, port, open, https,...) are ignored.

Solution:

  • read vite config
  • overwrite values in cli

Reproduction

import preprocess from 'svelte-preprocess';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://github.com/sveltejs/svelte-preprocess
	// for more information about preprocessors
	preprocess: preprocess(),

	kit: {
		// hydrate the <div id="svelte"> element in src/app.html
		target: '#svelte',
		vite: {
			server: {
				port: 987,
			}
		}
	}
};

export default config;

will not open server on port 987.

Logs

No response

System Info

System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 4.02 GB / 15.88 GB
  Binaries:
    Node: 14.17.2 - ~\AppData\Local\Volta\tools\image\node\14.17.2\node.EXE
    Yarn: 1.5.1 - C:\Program Files\Volta\yarn.EXE
    npm: 6.14.13 - ~\AppData\Local\Volta\tools\image\node\14.17.2\npm.CMD
  Browsers:
    Chrome: 92.0.4515.131
    Edge: Spartan (44.19041.906.0), Chromium (92.0.902.67)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.146
    svelte: ^3.34.0 => 3.42.1

Severity

annoyance

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature / enhancementNew feature or requestp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions