diff --git a/packages/app/src/_templates/views/app.template.html b/packages/app/src/_templates/views/app.template.html index 276240846d..f485f80d36 100644 --- a/packages/app/src/_templates/views/app.template.html +++ b/packages/app/src/_templates/views/app.template.html @@ -4,9 +4,7 @@ {{ HEAD }}
- {{ BODY_SCRIPTS_PREPEND }} {{ APP }} - {{ BODY_SCRIPTS }} <% if (nuxt.options.vite && nuxt.options.dev) { %> <% } %> diff --git a/packages/nitro/src/compat.ts b/packages/nitro/src/compat.ts index c9892ab80d..8bae40bfdf 100644 --- a/packages/nitro/src/compat.ts +++ b/packages/nitro/src/compat.ts @@ -53,14 +53,6 @@ export default function nuxt2CompatModule () { serverConfig.devtool = false }) - // Add missing template variables (which normally renderer would create) - nitroContext._internal.hooks.hook('nitro:document', (htmlTemplate) => { - if (!htmlTemplate.contents.includes('BODY_SCRIPTS_PREPEND')) { - const fullTemplate = ['{{ BODY_SCRIPTS_PREPEND }}', '{{ APP }}', '{{ BODY_SCRIPTS }}'].join('\n ') - htmlTemplate.contents = htmlTemplate.contents.replace('{{ APP }}', fullTemplate) - } - }) - // Nitro client plugin this.addPlugin({ fileName: 'nitro.client.js', diff --git a/packages/nitro/src/runtime/app/render.ts b/packages/nitro/src/runtime/app/render.ts index d8f0004f59..c1d86b8ced 100644 --- a/packages/nitro/src/runtime/app/render.ts +++ b/packages/nitro/src/runtime/app/render.ts @@ -121,9 +121,7 @@ function renderHTML (payload, rendered, ssrContext) { HEAD: meta.headTags + rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''), BODY_ATTRS: meta.bodyAttrs, - BODY_SCRIPTS_PREPEND: meta.bodyScriptsPrepend, - APP: _html + state + rendered.renderScripts(), - BODY_SCRIPTS: meta.bodyScripts + APP: meta.bodyScriptsPrepend + _html + state + rendered.renderScripts() + meta.bodyScripts }) }