mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 17:35:57 +00:00
parent
9797642d78
commit
c399f142b9
@ -4,9 +4,7 @@
|
||||
{{ HEAD }}
|
||||
</head>
|
||||
<body {{ BODY_ATTRS }}>
|
||||
{{ BODY_SCRIPTS_PREPEND }}
|
||||
{{ APP }}
|
||||
{{ BODY_SCRIPTS }}
|
||||
<% if (nuxt.options.vite && nuxt.options.dev) { %><script type="module" src="/@vite/client"></script>
|
||||
<script type="module" src="/entry.mjs"></script><% } %>
|
||||
</body>
|
||||
|
@ -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',
|
||||
|
@ -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
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user