mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +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
|
let needsLegacyContext = false
|
||||||
|
|
||||||
const plugins = _plugins.map((plugin) => {
|
const plugins = _plugins.map((plugin) => {
|
||||||
|
if (typeof plugin !== 'function') {
|
||||||
|
return () => {}
|
||||||
|
}
|
||||||
if (isLegacyPlugin(plugin)) {
|
if (isLegacyPlugin(plugin)) {
|
||||||
needsLegacyContext = true
|
needsLegacyContext = true
|
||||||
return (nuxtApp: NuxtApp) => plugin(nuxtApp._legacyContext!, nuxtApp.provide)
|
return (nuxtApp: NuxtApp) => plugin(nuxtApp._legacyContext!, nuxtApp.provide)
|
||||||
|
Loading…
Reference in New Issue
Block a user