mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 00:23:53 +00:00
fix(nuxt): access server build from webpack
memfs (#29027)
This commit is contained in:
parent
68451570df
commit
27a7ca3c1e
@ -545,6 +545,12 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
|||||||
|
|
||||||
// nuxt dev
|
// nuxt dev
|
||||||
if (nuxt.options.dev) {
|
if (nuxt.options.dev) {
|
||||||
|
nuxt.hook('webpack:compile', ({ name, compiler }) => {
|
||||||
|
if (name === 'server') {
|
||||||
|
const memfs = compiler.outputFileSystem as typeof import('node:fs')
|
||||||
|
nitro.options.virtual['#build/dist/server/server.mjs'] = () => memfs.readFileSync(join(nuxt.options.buildDir, 'dist/server/server.mjs'), 'utf-8')
|
||||||
|
}
|
||||||
|
})
|
||||||
nuxt.hook('webpack:compiled', () => { nuxt.server.reload() })
|
nuxt.hook('webpack:compiled', () => { nuxt.server.reload() })
|
||||||
nuxt.hook('vite:compiled', () => { nuxt.server.reload() })
|
nuxt.hook('vite:compiled', () => { nuxt.server.reload() })
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user