Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: css file rendered as type="module" script tag
  • Loading branch information
ThomasRalee committed Jul 25, 2022
commit 478f4caef6a8f3048cbcf1bcc210de9622c8cd3f
5 changes: 4 additions & 1 deletion packages/nuxt/src/core/runtime/nitro/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ 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 =>
file.endsWith('css') ? { css: file } : { file }
)
}

return Promise.resolve({
Expand All @@ -97,6 +99,7 @@ const getSPARenderer = lazyCachedFunction(async () => {
.join(''),
renderScripts: () =>
entryFiles
.filter(({ file }) => file != null)
.map(({ file }) => {
const isMJS = !file.endsWith('.js')
return `<script ${isMJS ? 'type="module"' : ''} src="${buildAssetsURL(file)}"></script>`
Expand Down