MCPcopy
hub / github.com/vitejs/vite / devToScanEnvironment

Function devToScanEnvironment

packages/vite/src/node/optimizer/scan.ts:75–99  ·  view source on GitHub ↗
(
  environment: DevEnvironment,
)

Source from the content-addressed store, hash-verified

73
74// Restrict access to the module graph and the server while scanning
75export function devToScanEnvironment(
76 environment: DevEnvironment,
77): ScanEnvironment {
78 return {
79 mode: 'scan',
80 get name() {
81 return environment.name
82 },
83 getTopLevelConfig() {
84 return environment.getTopLevelConfig()
85 },
86 get config() {
87 return environment.config
88 },
89 get logger() {
90 return environment.logger
91 },
92 get pluginContainer() {
93 return environment.pluginContainer
94 },
95 get plugins() {
96 return environment.plugins
97 },
98 } as unknown as ScanEnvironment
99}
100
101const debug = createDebugger('vite:deps')
102

Callers 2

scan.spec.tsFile · 0.90
initFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected