fix: move to mocked-exports rather than implicit unenv dep (#3232)

This commit is contained in:
Daniel Roe 2025-03-14 05:07:11 +00:00 committed by GitHub
parent 5623f87607
commit 1bf113a960
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 43 additions and 14 deletions

View file

@ -1,5 +1,6 @@
import type { BuildInfo } from './types'
import { createResolver, useNuxt } from '@nuxt/kit'
import { resolveModulePath } from 'exsolve'
import { isCI, isDevelopment, isWindows } from 'std-env'
import { isPreview } from './config/env'
import { currentLocales } from './config/i18n'
@ -7,6 +8,8 @@ import { pwa } from './config/pwa'
const { resolve } = createResolver(import.meta.url)
const mockProxy = resolveModulePath('mocked-exports/proxy', { from: import.meta.url })
export default defineNuxtConfig({
compatibilityDate: '2024-09-11',
typescript: {
@ -186,7 +189,7 @@ export default defineNuxtConfig({
},
nitro: {
alias: {
'isomorphic-ws': 'unenv/runtime/mock/proxy',
'isomorphic-ws': mockProxy,
},
esbuild: {
options: {
@ -230,7 +233,7 @@ export default defineNuxtConfig({
for (const dep of ['eventemitter3', 'isomorphic-ws'])
alias[dep] = resolve('./mocks/class')
for (const dep of ['fuse.js'])
alias[dep] = 'unenv/runtime/mock/proxy'
alias[dep] = mockProxy
const resolver = createResolver(import.meta.url)
config.plugins!.unshift({