mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
parent
9797642d78
commit
c399f142b9
@ -4,9 +4,7 @@
|
|||||||
{{ HEAD }}
|
{{ HEAD }}
|
||||||
</head>
|
</head>
|
||||||
<body {{ BODY_ATTRS }}>
|
<body {{ BODY_ATTRS }}>
|
||||||
{{ BODY_SCRIPTS_PREPEND }}
|
|
||||||
{{ APP }}
|
{{ APP }}
|
||||||
{{ BODY_SCRIPTS }}
|
|
||||||
<% if (nuxt.options.vite && nuxt.options.dev) { %><script type="module" src="/@vite/client"></script>
|
<% if (nuxt.options.vite && nuxt.options.dev) { %><script type="module" src="/@vite/client"></script>
|
||||||
<script type="module" src="/entry.mjs"></script><% } %>
|
<script type="module" src="/entry.mjs"></script><% } %>
|
||||||
</body>
|
</body>
|
||||||
|
@ -53,14 +53,6 @@ export default function nuxt2CompatModule () {
|
|||||||
serverConfig.devtool = false
|
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
|
// Nitro client plugin
|
||||||
this.addPlugin({
|
this.addPlugin({
|
||||||
fileName: 'nitro.client.js',
|
fileName: 'nitro.client.js',
|
||||||
|
@ -121,9 +121,7 @@ function renderHTML (payload, rendered, ssrContext) {
|
|||||||
HEAD: meta.headTags +
|
HEAD: meta.headTags +
|
||||||
rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''),
|
rendered.renderResourceHints() + rendered.renderStyles() + (ssrContext.styles || ''),
|
||||||
BODY_ATTRS: meta.bodyAttrs,
|
BODY_ATTRS: meta.bodyAttrs,
|
||||||
BODY_SCRIPTS_PREPEND: meta.bodyScriptsPrepend,
|
APP: meta.bodyScriptsPrepend + _html + state + rendered.renderScripts() + meta.bodyScripts
|
||||||
APP: _html + state + rendered.renderScripts(),
|
|
||||||
BODY_SCRIPTS: meta.bodyScripts
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user