mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 14:48:41 +00:00
fix(module-runner): make evaluator optional (#18672)
Some checks are pending
CI / Get changed files (push) Waiting to run
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (18, ubuntu-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (20, ubuntu-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (22, macos-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (22, ubuntu-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (22, windows-latest) (push) Blocked by required conditions
CI / Build & Test Passed or Skipped (push) Blocked by required conditions
CI / Build & Test Failed (push) Blocked by required conditions
CI / Lint: node-20, ubuntu-latest (push) Waiting to run
Preview release / preview (push) Waiting to run
Some checks are pending
CI / Get changed files (push) Waiting to run
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (18, ubuntu-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (20, ubuntu-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (22, macos-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (22, ubuntu-latest) (push) Blocked by required conditions
CI / Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }} (22, windows-latest) (push) Blocked by required conditions
CI / Build & Test Passed or Skipped (push) Blocked by required conditions
CI / Build & Test Failed (push) Blocked by required conditions
CI / Lint: node-20, ubuntu-latest (push) Waiting to run
Preview release / preview (push) Waiting to run
This commit is contained in:
parent
5ec9eedc80
commit
fd1283fe27
@ -33,6 +33,7 @@ import {
|
||||
import { hmrLogger, silentConsole } from './hmrLogger'
|
||||
import { createHMRHandler } from './hmrHandler'
|
||||
import { enableSourceMapSupport } from './sourcemap/index'
|
||||
import { ESModulesEvaluator } from './esmEvaluator'
|
||||
|
||||
interface ModuleRunnerDebugger {
|
||||
(formatter: unknown, ...args: unknown[]): void
|
||||
@ -61,7 +62,7 @@ export class ModuleRunner {
|
||||
|
||||
constructor(
|
||||
public options: ModuleRunnerOptions,
|
||||
public evaluator: ModuleEvaluator,
|
||||
public evaluator: ModuleEvaluator = new ESModulesEvaluator(),
|
||||
private debug?: ModuleRunnerDebugger,
|
||||
) {
|
||||
const root = this.options.root
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { ESModulesEvaluator, ModuleRunner } from 'vite/module-runner'
|
||||
import { ModuleRunner } from 'vite/module-runner'
|
||||
import type {
|
||||
ModuleEvaluator,
|
||||
ModuleRunnerHmr,
|
||||
@ -133,6 +133,6 @@ export function createServerModuleRunner(
|
||||
hmr,
|
||||
sourcemapInterceptor: resolveSourceMapOptions(options),
|
||||
},
|
||||
options.evaluator || new ESModulesEvaluator(),
|
||||
options.evaluator,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user