Skip to content

Commit 7ee26ad

Browse files
authored
[chore] remove cwd as a method parameter (#5040)
1 parent b6c88df commit 7ee26ad

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

packages/kit/src/cli.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ prog
6565
async function start(config) {
6666
const { dev } = await import('./core/dev/index.js');
6767

68-
const cwd = process.cwd();
69-
7068
const { address_info, server_config, close } = await dev({
71-
cwd,
7269
port,
7370
host,
7471
https,
@@ -82,8 +79,7 @@ prog
8279
open: first && (open || !!server_config.open),
8380
base: config.kit.paths.base,
8481
loose: server_config.fs.strict === false,
85-
allow: server_config.fs.allow,
86-
cwd
82+
allow: server_config.fs.allow
8783
});
8884

8985
first = false;

packages/kit/src/core/dev/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import { get_aliases, get_runtime_path } from '../utils.js';
77
import { create_plugin } from './plugin.js';
88
import * as sync from '../sync/sync.js';
99

10+
const cwd = process.cwd();
11+
1012
/**
1113
* @typedef {{
12-
* cwd: string,
1314
* port: number,
1415
* host?: string,
1516
* https: boolean,
@@ -19,7 +20,7 @@ import * as sync from '../sync/sync.js';
1920
*/
2021

2122
/** @param {Options} opts */
22-
export async function dev({ cwd, port, host, https, config }) {
23+
export async function dev({ port, host, https, config }) {
2324
sync.init(config);
2425

2526
const [vite_config] = deep_merge(
@@ -71,7 +72,7 @@ export async function dev({ cwd, port, host, https, config }) {
7172
},
7273
configFile: false
7374
}),
74-
await create_plugin(config, cwd)
75+
await create_plugin(config)
7576
],
7677
base: '/'
7778
});

packages/kit/src/core/dev/plugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ import { parse_route_id } from '../../utils/routing.js';
1717
// https://github.com/vitejs/vite/blob/3edd1af56e980aef56641a5a51cf2932bb580d41/packages/vite/src/node/plugins/css.ts#L96
1818
const style_pattern = /\.(css|less|sass|scss|styl|stylus|pcss|postcss)$/;
1919

20+
const cwd = process.cwd();
21+
2022
/**
2123
* @param {import('types').ValidatedConfig} config
22-
* @param {string} cwd
2324
* @returns {Promise<import('vite').Plugin>}
2425
*/
25-
export async function create_plugin(config, cwd) {
26+
export async function create_plugin(config) {
2627
const runtime = get_runtime_path(config);
2728

2829
process.env.VITE_SVELTEKIT_APP_VERSION_POLL_INTERVAL = '0';

0 commit comments

Comments
 (0)