mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(nitro): add temporary workarouind for ufo resolution in nuxt2
This commit is contained in:
parent
7b5bd53a02
commit
f66d917729
@ -1,5 +1,6 @@
|
||||
import fetch from 'node-fetch'
|
||||
import { resolve } from 'upath'
|
||||
import { resolveModule } from '@nuxt/kit'
|
||||
import { build, generate, prepare } from './build'
|
||||
import { getNitroContext, NitroContext } from './context'
|
||||
import { createDevServer } from './server/dev'
|
||||
@ -55,6 +56,15 @@ export default function nuxt2CompatModule () {
|
||||
src: resolve(nitroContext._internal.runtimeDir, 'app/nitro.client.js')
|
||||
})
|
||||
|
||||
// Fix module resolution
|
||||
nuxt.hook('webpack:config', (configs) => {
|
||||
for (const config of configs) {
|
||||
if (config.name === 'client') {
|
||||
config.resolve.alias.ufo = resolveModule('ufo/dist/index.mjs')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Resolve middleware
|
||||
nuxt.hook('modules:done', () => {
|
||||
const { middleware, legacyMiddleware } = resolveMiddleware(nuxt)
|
||||
|
Loading…
Reference in New Issue
Block a user