Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt): allow modules to disable appManifest without crashing #24786

Merged
merged 9 commits into from Dec 16, 2023
19 changes: 9 additions & 10 deletions packages/nuxt/src/core/nuxt.ts
Expand Up @@ -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))

Expand Down Expand Up @@ -400,6 +390,15 @@ async function initNuxt (nuxt: Nuxt) {
}

danielroe marked this conversation as resolved.
Show resolved Hide resolved
await nuxt.callHook('modules:done')
if (nuxt.options.experimental.appManifest) {
danielroe marked this conversation as resolved.
Show resolved Hide resolved
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'))
}

danielroe marked this conversation as resolved.
Show resolved Hide resolved
nuxt.hooks.hook('builder:watch', (event, relativePath) => {
const path = resolve(nuxt.options.srcDir, relativePath)
Expand Down