mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt): normalize manifest css file entries (#6112)
This commit is contained in:
parent
40defd9f36
commit
210cf30691
@ -83,7 +83,10 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
if ('all' in clientManifest && 'initial' in clientManifest) {
|
||||
// Upgrade legacy manifest (also see normalizeClientManifest in vue-bundle-renderer)
|
||||
// https://github.com/nuxt-contrib/vue-bundle-renderer/issues/12
|
||||
entryFiles = clientManifest.initial.map(file => ({ file }))
|
||||
entryFiles = clientManifest.initial.map(file =>
|
||||
// Webpack manifest fix with SPA renderer
|
||||
file.endsWith('css') ? { css: file } : { file }
|
||||
)
|
||||
}
|
||||
|
||||
return Promise.resolve({
|
||||
@ -97,6 +100,7 @@ const getSPARenderer = lazyCachedFunction(async () => {
|
||||
.join(''),
|
||||
renderScripts: () =>
|
||||
entryFiles
|
||||
.filter(({ file }) => file)
|
||||
.map(({ file }) => {
|
||||
const isMJS = !file.endsWith('.js')
|
||||
return `<script ${isMJS ? 'type="module"' : ''} src="${buildAssetsURL(file)}"></script>`
|
||||
|
@ -145,6 +145,12 @@ describe('head tags', () => {
|
||||
// should render <Head> components
|
||||
expect(index).toContain('<title>Basic fixture - Fixture</title>')
|
||||
})
|
||||
|
||||
// TODO: Doesn't adds header in test environment
|
||||
// it.todo('should render stylesheet link tag (SPA mode)', async () => {
|
||||
// const html = await $fetch('/head', { headers: { 'x-nuxt-no-ssr': '1' } })
|
||||
// expect(html).toMatch(/<link rel="stylesheet" href="\/_nuxt\/[^>]*.css"/)
|
||||
// })
|
||||
})
|
||||
|
||||
describe('navigate', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user