chore(app): entry types (#345)

[skip-release]
This commit is contained in:
Daniel Roe 2021-07-20 11:20:17 +01:00 committed by GitHub
parent 19794ddd21
commit 8d3f296e40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)