Skip to content

Commit

Permalink
refactor: remove default nodeModuleRunner because it's not used anywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Mar 25, 2024
1 parent a5ef42e commit f29e95a
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import launchEditorMiddleware from 'launch-editor-middleware'
import type { SourceMap } from 'rollup'
import picomatch from 'picomatch'
import type { Matcher } from 'picomatch'
import type { ModuleRunner } from 'vite/module-runner'
import type { CommonServerOptions } from '../http'
import {
httpServerStart,
Expand Down Expand Up @@ -51,7 +50,6 @@ import { printServerUrls } from '../logger'
import { createNoopWatcher, resolveChokidarOptions } from '../watch'
import { initPublicFiles } from '../publicDir'
import { getEnvFilesForMode } from '../env'
import { createServerModuleRunner } from '../ssr/runtime/serverModuleRunner'
import type { PluginContainer } from './pluginContainer'
import { ERR_CLOSED_SERVER, createPluginContainer } from './pluginContainer'
import type { WebSocketServer } from './ws'
Expand Down Expand Up @@ -268,10 +266,6 @@ export interface ViteDevServer {
* Module execution environments attached to the Vite server.
*/
environments: Record<string, DevEnvironment>
/**
* Default SSR module runner.
*/
nodeModuleRunner: ModuleRunner
/**
* Module graph that tracks the import relationships, url to file mapping
* and hmr state.
Expand Down Expand Up @@ -528,8 +522,6 @@ export async function _createServer(
onCrawlEndCallbacks.push(cb)
}

let nodeModuleRunner: ModuleRunner | undefined

let server: ViteDevServer = {
config,
middlewares,
Expand All @@ -542,16 +534,6 @@ export async function _createServer(
pluginContainer,
moduleGraph,

get nodeModuleRunner() {
if (!nodeModuleRunner) {
nodeModuleRunner = createServerModuleRunner(server.environments.ssr)
}
return nodeModuleRunner
},
set nodeModuleRunner(runner) {
nodeModuleRunner = runner
},

resolvedUrls: null, // will be set on listen
ssrTransform(
code: string,
Expand Down

0 comments on commit f29e95a

Please sign in to comment.