fix(compiler-sfc): should not transform external asset url with

includeAbsolute: true
This commit is contained in:
Evan You
2020-05-06 09:40:55 -04:00
parent 037fa07113
commit d66211849c
3 changed files with 7 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ import {
SourceLocation,
TransformContext
} from '@vue/compiler-core'
import { isRelativeUrl, parseUrl } from './templateUtils'
import { isRelativeUrl, parseUrl, isExternalUrl } from './templateUtils'
import { isArray } from '@vue/shared'
export interface AssetURLTagConfig {
@@ -98,6 +98,7 @@ export const transformAssetUrl: NodeTransform = (
attr.type !== NodeTypes.ATTRIBUTE ||
!assetAttrs.includes(attr.name) ||
!attr.value ||
isExternalUrl(attr.value.content) ||
(!options.includeAbsolute && !isRelativeUrl(attr.value.content))
) {
return