mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt3): allows plugins without default export (#1618)
This commit is contained in:
parent
5aa33b807c
commit
e58270a50f
@ -137,6 +137,9 @@ export function normalizePlugins (_plugins: Array<Plugin | LegacyPlugin>) {
|
||||
let needsLegacyContext = false
|
||||
|
||||
const plugins = _plugins.map((plugin) => {
|
||||
if (typeof plugin !== 'function') {
|
||||
return () => {}
|
||||
}
|
||||
if (isLegacyPlugin(plugin)) {
|
||||
needsLegacyContext = true
|
||||
return (nuxtApp: NuxtApp) => plugin(nuxtApp._legacyContext!, nuxtApp.provide)
|
||||
|
Loading…
Reference in New Issue
Block a user