MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / wrapEnvironmentResolveId

Function wrapEnvironmentResolveId

packages/vite/src/bridge/build.ts:152–174  ·  view source on GitHub ↗
(environment: BuildEnvironment, hook?: Plugin['resolveId'])

Source from the content-addressed store, hash-verified

150}
151
152function wrapEnvironmentResolveId(environment: BuildEnvironment, hook?: Plugin['resolveId']): Plugin['resolveId'] {
153 if (!hook) {
154 return;
155 }
156
157 const fn = getHookHandler(hook);
158 const handler: Plugin['resolveId'] = function (id, importer, options) {
159 return fn.call(
160 injectEnvironmentInContext(this, environment),
161 id,
162 importer,
163 injectSsrFlag(options, environment)
164 );
165 };
166
167 if ('handler' in hook) {
168 return {
169 ...hook,
170 handler
171 } as Plugin['resolveId'];
172 }
173 return handler;
174}
175
176function wrapEnvironmentLoad(environment: BuildEnvironment, hook?: Plugin['load']): Plugin['load'] {
177 if (!hook) {

Callers 1

injectEnvironmentToHooksFunction · 0.85

Calls 1

getHookHandlerFunction · 0.90

Tested by

no test coverage detected