mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 06:05:11 +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)
|
||||
|
||||
if (this.isServerMode) {
|
||||
return scripts.replace('<script', `<script nomodule`)
|
||||
return scripts
|
||||
}
|
||||
|
||||
const scriptPattern = /<script[^>]*?src="([^"]*?)" defer><\/script>/g
|
||||
@ -57,7 +57,7 @@ export default class ModernRenderer extends SSRRenderer {
|
||||
const legacyJsFile = jsFile.replace(this.publicPath, '')
|
||||
const modernJsFile = this.assetsMapping[legacyJsFile]
|
||||
if (!modernJsFile) {
|
||||
return scriptTag
|
||||
return scriptTag.replace('<script', `<script nomodule`)
|
||||
}
|
||||
const moduleTag = scriptTag
|
||||
.replace('<script', `<script type="module"`)
|
||||
|
Loading…
Reference in New Issue
Block a user