mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 02:17:15 +00:00
parent
19794ddd21
commit
8d3f296e40
@ -1,5 +1,5 @@
|
|||||||
import { createSSRApp, createApp, nextTick } from 'vue'
|
import { createSSRApp, createApp, nextTick } from 'vue'
|
||||||
import { createNuxt, applyPlugins, normalizePlugins } from '@nuxt/app'
|
import { createNuxt, applyPlugins, normalizePlugins, CreateOptions } from '@nuxt/app'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import _plugins from '#build/plugins'
|
import _plugins from '#build/plugins'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@ -10,7 +10,7 @@ let entry: Function
|
|||||||
const plugins = normalizePlugins(_plugins)
|
const plugins = normalizePlugins(_plugins)
|
||||||
|
|
||||||
if (process.server) {
|
if (process.server) {
|
||||||
entry = async function createNuxtAppServer (ssrContext = {}) {
|
entry = async function createNuxtAppServer (ssrContext: CreateOptions['ssrContext'] = {}) {
|
||||||
const app = createApp(App)
|
const app = createApp(App)
|
||||||
|
|
||||||
const nuxt = createNuxt({ app, ssrContext })
|
const nuxt = createNuxt({ app, ssrContext })
|
||||||
@ -28,6 +28,7 @@ if (process.client) {
|
|||||||
// https://github.com/webpack-contrib/webpack-hot-middleware/issues/390
|
// https://github.com/webpack-contrib/webpack-hot-middleware/issues/390
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
if (process.dev && import.meta.webpackHot) {
|
if (process.dev && import.meta.webpackHot) {
|
||||||
|
// @ts-ignore
|
||||||
import.meta.webpackHot.accept()
|
import.meta.webpackHot.accept()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,4 +54,4 @@ if (process.client) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ctx => entry(ctx)
|
export default (ctx?: CreateOptions['ssrContext']) => entry(ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user