Skip to content

Commit

Permalink
more api cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed May 26, 2022
1 parent be89323 commit ccdc634
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/kit/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ prog

async function start() {
const svelte_config = await load_config();
const { svelte, sveltekit } = await import('./core/dev/plugin.js');
const { plugins } = await import('./core/dev/plugin.js');
const vite_config = await svelte_config.kit.vite();

/** @type {import('vite').UserConfig} */
const config = {
plugins: [...(vite_config.plugins || []), svelte(svelte_config), sveltekit(svelte_config)]
plugins: [...(vite_config.plugins || []), plugins(svelte_config)]
};
config.server = config.server || {};

Expand Down
8 changes: 8 additions & 0 deletions packages/kit/src/core/dev/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,11 @@ export const svelte = function (svelte_config) {
configFile: false
});
};

/**
* @param {import('types').ValidatedConfig} svelte_config
* @return {import('vite').Plugin[]}
*/
export const plugins = function (svelte_config) {
return [...svelte(svelte_config), sveltekit(svelte_config)];
};

0 comments on commit ccdc634

Please sign in to comment.