mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
parent
19794ddd21
commit
8d3f296e40
@ -1,5 +1,5 @@
|
||||
import { createSSRApp, createApp, nextTick } from 'vue'
|
||||
import { createNuxt, applyPlugins, normalizePlugins } from '@nuxt/app'
|
||||
import { createNuxt, applyPlugins, normalizePlugins, CreateOptions } from '@nuxt/app'
|
||||
// @ts-ignore
|
||||
import _plugins from '#build/plugins'
|
||||
// @ts-ignore
|
||||
@ -10,7 +10,7 @@ let entry: Function
|
||||
const plugins = normalizePlugins(_plugins)
|
||||
|
||||
if (process.server) {
|
||||
entry = async function createNuxtAppServer (ssrContext = {}) {
|
||||
entry = async function createNuxtAppServer (ssrContext: CreateOptions['ssrContext'] = {}) {
|
||||
const app = createApp(App)
|
||||
|
||||
const nuxt = createNuxt({ app, ssrContext })
|
||||
@ -28,6 +28,7 @@ if (process.client) {
|
||||
// https://github.com/webpack-contrib/webpack-hot-middleware/issues/390
|
||||
// @ts-ignore
|
||||
if (process.dev && import.meta.webpackHot) {
|
||||
// @ts-ignore
|
||||
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