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

@@ -59,7 +59,8 @@ import _imports_1 from '/bar.png'
export function render(_ctx, _cache) {
return (_openBlock(), _createBlock(_Fragment, null, [
_createVNode(\\"img\\", { src: _imports_0 }),
_createVNode(\\"img\\", { src: _imports_1 })
_createVNode(\\"img\\", { src: _imports_1 }),
_createVNode(\\"img\\", { src: \\"https://foo.bar/baz.png\\" })
], 64 /* STABLE_FRAGMENT */))
}"
`;

View File

@@ -70,7 +70,9 @@ describe('compiler sfc: transform asset url', () => {
test('with includeAbsolute: true', () => {
const { code } = compileWithAssetUrls(
`<img src="./bar.png"></img>` + `<img src="/bar.png"></img>`,
`<img src="./bar.png"/>` +
`<img src="/bar.png"/>` +
`<img src="https://foo.bar/baz.png"/>`,
{
includeAbsolute: true
}