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

Method import

packages/vite/src/module-runner/runner.ts:90–93  ·  view source on GitHub ↗

* URL to execute. Accepts file path, server path or id relative to the root.

(url: string)

Source from the content-addressed store, hash-verified

88 * URL to execute. Accepts file path, server path or id relative to the root.
89 */
90 public async import<T = any>(url: string): Promise<T> {
91 const fetchedModule = await this.cachedModule(url)
92 return await this.cachedRequest(url, fetchedModule)
93 }
94
95 /**
96 * Clear all caches including HMR listeners.

Callers 15

constructorMethod · 0.95
instantiateModuleFunction · 0.80
runnerImportFunction · 0.80
server-hmr.spec.tsFile · 0.80
worker.invoke.mjsFile · 0.80
worker.mjsFile · 0.80
resolve.spec.tsFile · 0.80
scan.spec.tsFile · 0.80

Calls 2

cachedModuleMethod · 0.95
cachedRequestMethod · 0.95

Tested by 1

setupModuleRunnerFunction · 0.64