@vue/compiler-sfc
Advanced tools
Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.5
@@ -94,3 +94,3 @@ 'use strict'; | ||
} | ||
if (!node.children.length) { | ||
if (!node.children.length && !hasSrc(node)) { | ||
return; | ||
@@ -147,5 +147,9 @@ } | ||
const type = node.tag; | ||
const start = node.children[0].loc.start; | ||
const end = node.children[node.children.length - 1].loc.end; | ||
const content = source.slice(start.offset, end.offset); | ||
let { start, end } = node.loc; | ||
let content = ''; | ||
if (node.children.length) { | ||
start = node.children[0].loc.start; | ||
end = node.children[node.children.length - 1].loc.end; | ||
content = source.slice(start.offset, end.offset); | ||
} | ||
const loc = { | ||
@@ -227,2 +231,10 @@ source: content, | ||
} | ||
function hasSrc(node) { | ||
return node.props.some(p => { | ||
if (p.type !== 6 /* ATTRIBUTE */) { | ||
return false; | ||
} | ||
return p.name === 'src'; | ||
}); | ||
} | ||
@@ -229,0 +241,0 @@ function isRelativeUrl(url) { |
{ | ||
"name": "@vue/compiler-sfc", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0-alpha.5", | ||
"description": "@vue/compiler-sfc", | ||
@@ -30,7 +30,7 @@ "main": "dist/compiler-sfc.cjs.js", | ||
"peerDependencies": { | ||
"vue": "3.0.0-alpha.4" | ||
"vue": "3.0.0-alpha.5" | ||
}, | ||
"dependencies": { | ||
"@vue/compiler-core": "3.0.0-alpha.4", | ||
"@vue/compiler-dom": "3.0.0-alpha.4", | ||
"@vue/compiler-core": "3.0.0-alpha.5", | ||
"@vue/compiler-dom": "3.0.0-alpha.5", | ||
"consolidate": "^0.15.1", | ||
@@ -37,0 +37,0 @@ "hash-sum": "^2.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38568
967
+ Added@vue/compiler-core@3.0.0-alpha.5(transitive)
+ Added@vue/compiler-dom@3.0.0-alpha.5(transitive)
+ Added@vue/reactivity@3.0.0-alpha.5(transitive)
+ Added@vue/runtime-core@3.0.0-alpha.5(transitive)
+ Added@vue/runtime-dom@3.0.0-alpha.5(transitive)
+ Addedvue@3.0.0-alpha.5(transitive)
- Removed@vue/compiler-core@3.0.0-alpha.4(transitive)
- Removed@vue/compiler-dom@3.0.0-alpha.4(transitive)
- Removed@vue/reactivity@3.0.0-alpha.4(transitive)
- Removed@vue/runtime-core@3.0.0-alpha.4(transitive)
- Removed@vue/runtime-dom@3.0.0-alpha.4(transitive)
- Removedvue@3.0.0-alpha.4(transitive)