mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
fix(automock): don't externalize .ts imports
This commit is contained in:
parent
82b585dbb0
commit
d95e002d5b
@ -1,10 +1,12 @@
|
||||
import consola from 'consola'
|
||||
|
||||
const internalRegex = /^\.|\?|\.[mc]?js$|.ts$/
|
||||
|
||||
export function autoMock () {
|
||||
return {
|
||||
name: 'auto-mock',
|
||||
resolveId (src: string) {
|
||||
if (src && !src.startsWith('.') && !src.includes('?') && !src.includes('.js')) {
|
||||
if (src && !internalRegex.test(src)) {
|
||||
consola.warn('Auto mock external ', src)
|
||||
return {
|
||||
id: require.resolve('unenv/runtime/mock/proxy')
|
||||
|
Loading…
Reference in New Issue
Block a user