fix(nuxt): add appManifest middleware after modules run (#24786)

This commit is contained in:
Nathanaël Labreuil 2023-12-16 10:12:22 +01:00 committed by GitHub
parent 40a5f44942
commit 6f3cf42c9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,16 +94,6 @@ async function initNuxt (nuxt: Nuxt) {
addVitePlugin(() => ImportProtectionPlugin.vite(config))
addWebpackPlugin(() => ImportProtectionPlugin.webpack(config))
if (nuxt.options.experimental.appManifest) {
addRouteMiddleware({
name: 'manifest-route-rule',
path: resolve(nuxt.options.appDir, 'middleware/manifest-route-rule'),
global: true
})
addPlugin(resolve(nuxt.options.appDir, 'plugins/check-outdated-build.client'))
}
// add resolver for modules used in virtual files
addVitePlugin(() => resolveDeepImportsPlugin(nuxt))
@ -401,6 +391,16 @@ async function initNuxt (nuxt: Nuxt) {
await nuxt.callHook('modules:done')
if (nuxt.options.experimental.appManifest) {
addRouteMiddleware({
name: 'manifest-route-rule',
path: resolve(nuxt.options.appDir, 'middleware/manifest-route-rule'),
global: true
})
addPlugin(resolve(nuxt.options.appDir, 'plugins/check-outdated-build.client'))
}
nuxt.hooks.hook('builder:watch', (event, relativePath) => {
const path = resolve(nuxt.options.srcDir, relativePath)
// Local module patterns