Detection of Vue.js v2 and v3 improved (#825)

This commit is contained in:
nobody 2021-12-28 08:09:11 +01:00
parent 2c4629d87a
commit cbf0c058c0
No known key found for this signature in database
GPG Key ID: 8F6DE3D614FCFD7A
2 changed files with 17 additions and 3 deletions

View File

@ -201,9 +201,22 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
'path': `resources/materialize/1.0.0/${channelPath}`,
'bundle': 'Materialize'
};
} else if ((/cdn\.jsdelivr\.net\/npm\/vue@(2|3)/).test(CompleteURL)) {
let version = CompleteURL.match(Resource.VERSION_EXPRESSION);
lastVersion = targets.setLastVersion(`/vue/${version}.`);
} else if (CompleteURL === 'cdn.jsdelivr.net/npm/vue@2') {
lastVersion = targets.setLastVersion('/vue/2.');
if (lastVersion === '') {
return {
'result': false,
};
}
return {
'source': channelHost,
'versionDelivered': lastVersion,
'versionRequested': lastVersion,
'path': `resources/vue/${lastVersion}/vue.min.jsm`,
'bundle': ''
};
} else if (CompleteURL === 'cdn.jsdelivr.net/npm/vue@3') {
lastVersion = targets.setLastVersion('/vue/3.');
if (lastVersion === '') {
return {
'result': false,

View File

@ -38,6 +38,7 @@
<ul>
<li>Include CNAME of CDNs (<a href="https://codeberg.org/nobody/LocalCDN/issues/816">#816</a>)</li>
<li>Removed obsolete CDN (<a href="https://codeberg.org/nobody/LocalCDN/issues/786">#786</a>)</li>
<li>Detection of Vue.js v2 and v3 improved (<a href="https://codeberg.org/nobody/LocalCDN/issues/825">#825</a>)</li>
</ul>
</div>
<div id="generator-section">