fix(nuxt): ensure plugins retain original order (#23174)

This commit is contained in:
Daniel Roe 2023-09-13 09:35:11 +01:00 committed by GitHub
parent 6afbdc349e
commit 8c1eaa0078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,7 +143,7 @@ async function resolveApp (nuxt: Nuxt, app: NuxtApp) {
}
// Add back plugins not specified in layers or user config
for (const p of nuxt.options.plugins) {
for (const p of [...nuxt.options.plugins].reverse()) {
const plugin = normalizePlugin(p)
if (!app.plugins.some(p => p.src === plugin.src)) {
app.plugins.unshift(plugin)