fix(modern): missing nomodule on legacy modules (#7919)

This commit is contained in:
Xin Du (Clark) 2020-08-14 22:59:10 +01:00 committed by GitHub
parent 10e82b24da
commit 68b9183c4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 return scripts.replace('<script', `<script nomodule`)
} }
const scriptPattern = /<script[^>]*?src="([^"]*?)" defer><\/script>/g const scriptPattern = /<script[^>]*?src="([^"]*?)" defer><\/script>/g