mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
fix(vue-renderer): apply nomodule
to legacy chunks (#7928)
closes #7927
This commit is contained in:
parent
37c903fae8
commit
f1a95c8af8
@ -48,7 +48,7 @@ export default class ModernRenderer extends SSRRenderer {
|
|||||||
const scripts = super.renderScripts(renderContext)
|
const scripts = super.renderScripts(renderContext)
|
||||||
|
|
||||||
if (this.isServerMode) {
|
if (this.isServerMode) {
|
||||||
return scripts.replace('<script', `<script nomodule`)
|
return scripts
|
||||||
}
|
}
|
||||||
|
|
||||||
const scriptPattern = /<script[^>]*?src="([^"]*?)" defer><\/script>/g
|
const scriptPattern = /<script[^>]*?src="([^"]*?)" defer><\/script>/g
|
||||||
@ -57,7 +57,7 @@ export default class ModernRenderer extends SSRRenderer {
|
|||||||
const legacyJsFile = jsFile.replace(this.publicPath, '')
|
const legacyJsFile = jsFile.replace(this.publicPath, '')
|
||||||
const modernJsFile = this.assetsMapping[legacyJsFile]
|
const modernJsFile = this.assetsMapping[legacyJsFile]
|
||||||
if (!modernJsFile) {
|
if (!modernJsFile) {
|
||||||
return scriptTag
|
return scriptTag.replace('<script', `<script nomodule`)
|
||||||
}
|
}
|
||||||
const moduleTag = scriptTag
|
const moduleTag = scriptTag
|
||||||
.replace('<script', `<script type="module"`)
|
.replace('<script', `<script type="module"`)
|
||||||
|
Loading…
Reference in New Issue
Block a user