Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
Something went wrong. Try again.
471 B · 20 lines
TypeScript
123456789101112131415161718192021if (globalThis.process?.env.VITE_MODULE_RUNNER === 'false') { const { registerHooks } = await import('node:module')
registerHooks({ resolve(specifier, context, nextResolve) { if ( context.parentURL && specifier.startsWith('.') && !/\.[a-z]+$/.test(specifier) && !context.parentURL.includes('/node_modules/') ) { specifier += '.ts' }
return nextResolve(specifier, context) }, })}
export {}