MCPcopy
hub / github.com/vitest-dev/vitest / setup

Function setup

packages/browser/src/node/plugin.ts:563–572  ·  view source on GitHub ↗
(build: any)

Source from the content-addressed store, hash-verified

561 name: 'test-utils-rewrite',
562 // "any" because vite doesn't expose any types for this
563 setup(build: any) {
564 // test-utils: resolve to CJS instead of the browser because the browser version expects a global Vue object
565 // compiler-core: only CJS version allows slots as strings
566 build.onResolve({ filter: /^@vue\/(test-utils|compiler-core)$/ }, (args: any) => {
567 const resolved = getRequire().resolve(args.path, {
568 paths: [args.importer],
569 })
570 return { path: resolved }
571 })
572 },
573 }
574
575 return {

Callers

nothing calls this directly

Calls 2

getRequireFunction · 0.85
resolveMethod · 0.45

Tested by

no test coverage detected