|
|
@@ -319,11 +319,14 @@ export function resolveAsset (
|
|
|
return
|
|
|
}
|
|
|
const assets = options[type]
|
|
|
- const res = assets[id] ||
|
|
|
- // camelCase ID
|
|
|
- assets[camelize(id)] ||
|
|
|
- // Pascal Case ID
|
|
|
- assets[capitalize(camelize(id))]
|
|
|
+ // check local registration variations first
|
|
|
+ if (hasOwn(assets, id)) return assets[id]
|
|
|
+ const camelizedId = camelize(id)
|
|
|
+ if (hasOwn(assets, camelizedId)) return assets[camelizedId]
|
|
|
+ const PascalCaseId = capitalize(camelizedId)
|
|
|
+ if (hasOwn(assets, PascalCaseId)) return assets[PascalCaseId]
|
|
|
+ // fallback to prototype chain
|
|
|
+ const res = assets[id] || assets[camelizedId] || assets[PascalCaseId]
|
|
|
if (process.env.NODE_ENV !== 'production' && warnMissing && !res) {
|
|
|
warn(
|
|
|
'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
|